unioslo / zabbix-auto-config

MIT License
3 stars 6 forks source link

Better handling of missing prerequisites #53

Open paalbra opened 1 year ago

paalbra commented 1 year ago

Zac will crash if Zabbix doesn't contain some prerequisites, like the host groups All-auto-disabled-hosts and All-hosts.

Maybe create a simple function that can sanity check Zabbix for all prerequisites upon startup and create a better error log/handle the "crash" in a better way?

paalbra commented 1 year ago

E.g currently it'll just crash with something like:

...
  File "zabbix-auto-config/zabbix_auto_config/processing.py", line 391, in disable_host
    disabled_hostgroup_id = self.api.hostgroup.get(filter={"name": self.config.hostgroup_disabled})[0]["groupid"]
IndexError: list index out of range
2023-03-17T15:36:12+0100 ERROR [MainProcess 183722] [root] A child has died: zabbix-host-updater. Exiting
...