Merge pull request #94 from TheNetworkGuy/develop

implements fix for hostgroup - host API call
This commit is contained in:
Twan Kamans 2025-02-05 10:54:05 +01:00 committed by GitHub
commit 4c982ff0f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -540,6 +540,7 @@ class PhysicalDevice():
'port', 'details',
'interfaceid'],
selectGroups=["groupid"],
selectHostGroups=["groupid"],
selectParentTemplates=["templateid"],
selectInventory=list(inventory_map.values()))
if len(host) > 1:
@ -582,7 +583,11 @@ class PhysicalDevice():
else:
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:
self.logger.debug(f"Host {self.name}: hostgroup in-sync.")
break