mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2026-03-21 20:18:38 -06:00
Fixed check for future Zabbix versions.
This commit is contained in:
@@ -214,7 +214,7 @@ class Sync:
|
||||
logger=logger,
|
||||
)
|
||||
# Set API parameter mapping based on API version
|
||||
proxy_name = "host" if not str(self.zabbix.version).startswith("7") else "name"
|
||||
proxy_name = "host" if str(self.zabbix.version) < "7" else "name"
|
||||
# Get all Zabbix and NetBox data
|
||||
netbox_devices = list(
|
||||
self.netbox.dcim.devices.filter(**self.config["nb_device_filter"])
|
||||
@@ -240,7 +240,7 @@ class Sync:
|
||||
)
|
||||
# Set empty list for proxy processing Zabbix <= 6
|
||||
zabbix_proxygroups = []
|
||||
if self.zabbix.version >= "7":
|
||||
if str(self.zabbix.version) >= "7":
|
||||
zabbix_proxygroups = self.zabbix.proxygroup.get( # type: ignore
|
||||
output=["proxy_groupid", "name"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user