mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-16 04:02:56 -06:00
Merge branch 'develop' into hostgroup_static_text
This commit is contained in:
commit
cf2c841d23
@ -112,7 +112,8 @@ class PhysicalDevice:
|
|||||||
self.visible_name = self.nb.name
|
self.visible_name = self.nb.name
|
||||||
self.use_visible_name = True
|
self.use_visible_name = True
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
"Host %s contains special characters. Using %s as name for the NetBox object and using %s as visible name in Zabbix.",
|
"Host %s contains special characters."
|
||||||
|
"Using %s as name for the NetBox object and using %s as visible name in Zabbix.",
|
||||||
self.visible_name,
|
self.visible_name,
|
||||||
self.name,
|
self.name,
|
||||||
self.visible_name,
|
self.visible_name,
|
||||||
@ -213,7 +214,8 @@ class PhysicalDevice:
|
|||||||
if config["inventory_mode"] == "disabled":
|
if config["inventory_mode"] == "disabled":
|
||||||
if config["inventory_sync"]:
|
if config["inventory_sync"]:
|
||||||
self.logger.error(
|
self.logger.error(
|
||||||
"Host %s: Unable to map NetBox inventory to Zabbix. Inventory sync is enabled in config but inventory mode is disabled",
|
"Host %s: Unable to map NetBox inventory to Zabbix."
|
||||||
|
"Inventory sync is enabled in config but inventory mode is disabled",
|
||||||
self.name,
|
self.name,
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
@ -773,7 +775,8 @@ class PhysicalDevice:
|
|||||||
if proxy_power and proxy_set:
|
if proxy_power and proxy_set:
|
||||||
# Zabbix <= 6 fix
|
# Zabbix <= 6 fix
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
"Host %s: No proxy is configured in NetBox but is configured in Zabbix. Removing proxy config in Zabbix",
|
"Host %s: No proxy is configured in NetBox but is configured in Zabbix."
|
||||||
|
"Removing proxy config in Zabbix",
|
||||||
self.name,
|
self.name,
|
||||||
)
|
)
|
||||||
if "proxy_hostid" in host and bool(host["proxy_hostid"]):
|
if "proxy_hostid" in host and bool(host["proxy_hostid"]):
|
||||||
@ -788,7 +791,8 @@ class PhysicalDevice:
|
|||||||
if proxy_set and not proxy_power:
|
if proxy_set and not proxy_power:
|
||||||
# Display error message
|
# Display error message
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
"Host %s: Is configured with proxy in Zabbix but not in NetBox. The -p flag was ommited: no changes have been made.",
|
"Host %s: Is configured with proxy in Zabbix but not in NetBox."
|
||||||
|
"The -p flag was ommited: no changes have been made.",
|
||||||
self.name,
|
self.name,
|
||||||
)
|
)
|
||||||
if not proxy_set:
|
if not proxy_set:
|
||||||
@ -938,7 +942,9 @@ class PhysicalDevice:
|
|||||||
return True
|
return True
|
||||||
except NetboxRequestError as e:
|
except NetboxRequestError as e:
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
"Unable to create journal entry for %s: NB returned {e}", self.name
|
"Unable to create journal entry for %s: NB returned %s",
|
||||||
|
self.name,
|
||||||
|
e,
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user