Merge pull request #4 from TheNetworkGuy/main

Merge from upstream
This commit is contained in:
Raymond Kuiper 2025-02-14 16:38:11 +01:00 committed by GitHub
commit 53d679e638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -545,6 +545,7 @@ class PhysicalDevice():
'port', 'details', 'port', 'details',
'interfaceid'], 'interfaceid'],
selectGroups=["groupid"], selectGroups=["groupid"],
selectHostGroups=["groupid"],
selectParentTemplates=["templateid"], selectParentTemplates=["templateid"],
selectInventory=list(self._inventory_map().values())) selectInventory=list(self._inventory_map().values()))
if len(host) > 1: if len(host) > 1:
@ -587,7 +588,11 @@ class PhysicalDevice():
else: else:
self.logger.debug(f"Host {self.name}: template(s) in-sync.") self.logger.debug(f"Host {self.name}: template(s) in-sync.")
for group in host["groups"]: # Check if Zabbix version is 6 or higher. Issue #93
group_dictname = "hostgroups"
if str(self.zabbix.version).startswith(('6', '5')):
group_dictname = "groups"
for group in host[group_dictname]:
if group["groupid"] == self.group_id: if group["groupid"] == self.group_id:
self.logger.debug(f"Host {self.name}: hostgroup in-sync.") self.logger.debug(f"Host {self.name}: hostgroup in-sync.")
break break

View File

@ -1,2 +1,2 @@
pynetbox pynetbox
zabbix_utils zabbix-utils==2.0.1