mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-13 15:24:48 -06:00
Fixed multiple hostgroups for devices
This commit is contained in:
parent
f7eb47a8a8
commit
27ee4c341f
@ -337,15 +337,13 @@ class PhysicalDevice:
|
|||||||
OUTPUT: True / False
|
OUTPUT: True / False
|
||||||
"""
|
"""
|
||||||
# Go through all groups
|
# Go through all groups
|
||||||
self.logger.debug(self.hostgroups)
|
|
||||||
|
|
||||||
for hg in self.hostgroups:
|
for hg in self.hostgroups:
|
||||||
for group in groups:
|
for group in groups:
|
||||||
if group["name"] == hg:
|
if group["name"] == hg:
|
||||||
self.group_ids.append({"groupid": group["groupid"]})
|
self.group_ids.append({"groupid": group["groupid"]})
|
||||||
e = f"Host {self.name}: matched group {group['name']}"
|
e = f"Host {self.name}: matched group \"{group['name']}\" (ID:{group['groupid']})"
|
||||||
self.logger.debug(e)
|
self.logger.debug(e)
|
||||||
if self.group_ids:
|
if len(self.group_ids) == len(self.hostgroups):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user