Skip to content

Commit

Permalink
zabbix-vsphere-import: Add method for creating a hostgroup in Zabbix
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Apr 23, 2014
1 parent 40d273d commit 0ad2fee
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/misc-tools/zabbix-vsphere-import
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,30 @@ class ZabbixConnector(object):

return group['groupid']

def create_host_group(self, name):
"""
Create a Zabbix host group
Args:
name (str): Name of the host group to create
Returns:
The id of the newly create host group
"""
logging.info(
'[%s] Creating Zabbix host group %s',
self.options['zabbix']['hostname'],
name
)

result = self._call_zabbix_method(
method='hostgroup.create',
params={'name': name}
)

return result['groupids']

def create_host(self, host):
"""
Create a Zabbix host
Expand Down

0 comments on commit 0ad2fee

Please sign in to comment.