Added debug line for showing Zabbix version and modified check for Zabbix versions above 6.x.x for proxy configuration

This commit is contained in:
TheNetworkGuy
2026-02-23 13:23:27 +01:00
parent 489a70b703
commit 449704156c
+2 -1
View File
@@ -130,6 +130,7 @@ class Sync:
logger.debug("Using token authentication for Zabbix API.")
self.zabbix = ZabbixAPI(zbx_host, token=zbx_token, ssl_context=ssl_ctx)
self.zabbix.check_auth()
logger.debug("Zabbix version is %s.", self.zabbix.version)
except (APIRequestError, ProcessingError) as zbx_error:
e = f"Zabbix returned the following error: {zbx_error}."
logger.error(e)
@@ -239,7 +240,7 @@ class Sync:
)
# Set empty list for proxy processing Zabbix <= 6
zabbix_proxygroups = []
if str(self.zabbix.version).startswith("7"):
if self.zabbix.version >= "7":
zabbix_proxygroups = self.zabbix.proxygroup.get( # type: ignore
output=["proxy_groupid", "name"]
)