Update netbox_zabbix_sync.py

Minor bug fix for empty Netbox to zabbix inventory field mappings.
This commit is contained in:
Raymond Kuiper
2024-04-10 14:57:08 +02:00
committed by GitHub
parent 634f4b77d5
commit 3e638c6f78

View File

@@ -408,7 +408,7 @@ class NetworkDevice():
value = nbdevice
# ... and step through the dict till we find the needed value
for item in field_list:
value = value[item]
value = value[item] if value else None
# Check if the result is usable and expected
if value and isinstance(value, int | float | str ):
self.inventory[zbx_inv_field] = str(value)