mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-14 09:51:26 -06:00
Fixes #15
This commit is contained in:
parent
66ceaffb11
commit
17969c1da5
@ -64,9 +64,9 @@ def main(arguments):
|
|||||||
# Get all Zabbix and Netbox data
|
# Get all Zabbix and Netbox data
|
||||||
netbox_devices = netbox.dcim.devices.all()
|
netbox_devices = netbox.dcim.devices.all()
|
||||||
netbox_journals = netbox.extras.journal_entries
|
netbox_journals = netbox.extras.journal_entries
|
||||||
zabbix_groups = zabbix.hostgroup.get(output=['name'])
|
zabbix_groups = zabbix.hostgroup.get(output=['groupid', 'name'])
|
||||||
zabbix_templates = zabbix.template.get(output=['name'])
|
zabbix_templates = zabbix.template.get(output=['templateid', 'name'])
|
||||||
zabbix_proxys = zabbix.proxy.get(output=['host'])
|
zabbix_proxys = zabbix.proxy.get(output=['proxyid', 'host'])
|
||||||
# Go through all Netbox devices
|
# Go through all Netbox devices
|
||||||
for nb_device in netbox_devices:
|
for nb_device in netbox_devices:
|
||||||
try:
|
try:
|
||||||
@ -459,8 +459,8 @@ class NetworkDevice():
|
|||||||
selectInterfaces=['type', 'ip',
|
selectInterfaces=['type', 'ip',
|
||||||
'port', 'details',
|
'port', 'details',
|
||||||
'interfaceid'],
|
'interfaceid'],
|
||||||
selectGroups=["id"],
|
selectGroups=["groupid"],
|
||||||
selectParentTemplates=["id"])
|
selectParentTemplates=["templateid"])
|
||||||
if(len(host) > 1):
|
if(len(host) > 1):
|
||||||
e = (f"Got {len(host)} results for Zabbix hosts "
|
e = (f"Got {len(host)} results for Zabbix hosts "
|
||||||
f"with ID {self.zabbix_id} - hostname {self.name}.")
|
f"with ID {self.zabbix_id} - hostname {self.name}.")
|
||||||
|
Loading…
Reference in New Issue
Block a user