mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-12-26 23:17:43 -06:00
* Added support for object and select custom fields in host groups and proxy config.
* Corrected error when `full_proxy_sync` was not set and a host no longer uses a proxy.
This commit is contained in:
@@ -50,6 +50,19 @@ def proxy_prepper(proxy_list, proxy_group_list):
|
||||
return output
|
||||
|
||||
|
||||
def cf_to_string(cf, key="name", logger=None):
|
||||
"""
|
||||
Converts a dict custom fields to string
|
||||
"""
|
||||
if isinstance(cf, dict):
|
||||
if key:
|
||||
return cf[key]
|
||||
else:
|
||||
logger.error("Conversion of custom field failed, '%s' not found in cf dict.", key)
|
||||
return None
|
||||
return cf
|
||||
|
||||
|
||||
def field_mapper(host, mapper, nbdevice, logger):
|
||||
"""
|
||||
Maps NetBox field data to Zabbix properties.
|
||||
@@ -204,4 +217,4 @@ def sanatize_log_output(data):
|
||||
continue
|
||||
# A macro is not used, so we sanitize the value.
|
||||
sanitized_data["details"][key] = "********"
|
||||
return sanitized_data
|
||||
return sanitized_data
|
||||
Reference in New Issue
Block a user