From 14c83ba50d1376862783a4de44a22acf03ff8a7d Mon Sep 17 00:00:00 2001 From: TheNetworkGuy Date: Tue, 22 Nov 2022 11:19:10 +0100 Subject: [PATCH] Filtering devices which do not have a name. Posible related to #22, nontheless a good practice to ignore these devices. --- netbox_zabbix_sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_zabbix_sync.py b/netbox_zabbix_sync.py index 8de99ca..564131f 100755 --- a/netbox_zabbix_sync.py +++ b/netbox_zabbix_sync.py @@ -72,7 +72,7 @@ def main(arguments): # Set Netbox API netbox = api(netbox_host, token=netbox_token, threading=True) # Get all Zabbix and Netbox data - netbox_devices = netbox.dcim.devices.all() + netbox_devices = netbox.dcim.devices.filter(name__n="null") netbox_journals = netbox.extras.journal_entries zabbix_groups = zabbix.hostgroup.get(output=['groupid', 'name']) zabbix_templates = zabbix.template.get(output=['templateid', 'name'])