Skip to content

Commit

Permalink
Sync importance groups
Browse files Browse the repository at this point in the history
  • Loading branch information
paalbra committed Jun 8, 2020
1 parent d0596d2 commit 9ff0b81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zabbix_auto_config/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ def do_update(self):
zabbix_hostgroups[zabbix_hostgroup["name"]] = zabbix_hostgroup["groupid"]
if zabbix_hostgroup["name"].startswith("Source-"):
managed_hostgroup_names.add(zabbix_hostgroup["name"])
if zabbix_hostgroup["name"].startswith("Importance-"):
managed_hostgroup_names.add(zabbix_hostgroup["name"])
managed_hostgroup_names.update(["All-hosts"])

with self.db_connection, self.db_connection.cursor() as db_cursor:
Expand Down Expand Up @@ -677,6 +679,8 @@ def do_update(self):
synced_hostgroup_names.update(self.siteadmin_hostgroup_map[siteadmin])
for source in db_host["sources"]:
synced_hostgroup_names.add(f"Source-{source}")
if "importance" in db_host:
synced_hostgroup_names.add(f"Importance-{db_host['importance']}")

host_hostgroups = {}
for zabbix_hostgroup in zabbix_host["groups"]:
Expand Down

0 comments on commit 9ff0b81

Please sign in to comment.