|
|
@ -24,7 +24,7 @@ Zabbix Server external inventory script.
|
|
|
|
========================================
|
|
|
|
========================================
|
|
|
|
|
|
|
|
|
|
|
|
Returns hosts and hostgroups from Zabbix Server.
|
|
|
|
Returns hosts and hostgroups from Zabbix Server.
|
|
|
|
If you want to run with --limit against a host group with space in the
|
|
|
|
If you want to run with --limit against a host group with space in the
|
|
|
|
name, use asterisk. For example --limit="Linux*servers".
|
|
|
|
name, use asterisk. For example --limit="Linux*servers".
|
|
|
|
|
|
|
|
|
|
|
|
Configuration is read from `zabbix.ini`.
|
|
|
|
Configuration is read from `zabbix.ini`.
|
|
|
@ -104,18 +104,18 @@ class ZabbixInventory(object):
|
|
|
|
|
|
|
|
|
|
|
|
data[groupname]['hosts'].append(hostname)
|
|
|
|
data[groupname]['hosts'].append(hostname)
|
|
|
|
|
|
|
|
|
|
|
|
# Prevents Ansible from calling this script for each server with --host
|
|
|
|
# Prevents Ansible from calling this script for each server with --host
|
|
|
|
data['_meta'] = { 'hostvars': self.meta }
|
|
|
|
data['_meta'] = {'hostvars': self.meta}
|
|
|
|
|
|
|
|
|
|
|
|
return data
|
|
|
|
return data
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
def __init__(self):
|
|
|
|
|
|
|
|
|
|
|
|
self.defaultgroup = 'group_all'
|
|
|
|
self.defaultgroup = 'group_all'
|
|
|
|
self.zabbix_server = None
|
|
|
|
self.zabbix_server = None
|
|
|
|
self.zabbix_username = None
|
|
|
|
self.zabbix_username = None
|
|
|
|
self.zabbix_password = None
|
|
|
|
self.zabbix_password = None
|
|
|
|
self.meta = {}
|
|
|
|
self.meta = {}
|
|
|
|
|
|
|
|
|
|
|
|
self.read_settings()
|
|
|
|
self.read_settings()
|
|
|
|
self.read_cli()
|
|
|
|
self.read_cli()
|
|
|
|