* 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:
Raymond Kuiper
2025-09-12 14:11:38 +02:00
parent 123b243f56
commit 422d343c1f
4 changed files with 24 additions and 11 deletions

View File

@@ -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