This script listens to Icinga2 API and acknowledges hosts and services during they downtimes.
It also acknowledges hosts and services with autoack
variable set.
Why? Because there are some buggy notification tools which do not honor "in downtime" but does work with acknowledged state. 🤦
This program is in proof-of-concept state. But it is already used in production. 🤷
Create Icinga2 API user in `/etc/icinga2/
object ApiUser "autoack" {
password = "mrznawrxbxbg"
permissions = [
"objects/query/Host",
"objects/query/Service",
"objects/query/Downtime",
"actions/acknowledge-problem",
"events/*",
"status/query",
]
}
Create icinga2-api.ini
according to icinga2api
module configuration.
[api]
url = https://my-icinga-hostname:5665/
username = auto-ack
password = mrznawrxbxbg
ca_certificate = ./icinga2-ca.crt
Copy certificate from /var/lib/icinga2/ca/ca.crt
to
your directory.
Start the script (possibly in Pipfile managed virtualenv).
BSD-2