I’ve been using Icinga2 for clustered setups for quit a a few years. Normally I handle configuration using config files in zones.d/ and deploy these using Ansible or similar. Works fine. I have also worked with the API to dynamically add and remove hosts.
Now I have a setup where many services are configured from host variables. Problem is that these variables need to changes dynamically and it is not feasible to handle those changes by deploying new static configuration files.
Enter the API. There is no problem to update the the relevant host variables using the API. Problem is that I cannot in any way get the the services to actually re-evaluate the new host variable values. There are some (not that clear) disclaimers about this in the API documentation (in the Modifying Objects section). Also there are some issues indicating this on Github.
That’s fine but one would expect these updated variables to be re-evaluated at some point! Even a restart of the daemon doesn’t trigger any changes!
Just to be specific, say I have a host variable “a=1”, I then have a service using this variable as parameter to a check command, say “vars.http_uri = “/” + host.vars.a”. My idea is that changing “a=2” should, at some point" change the check URI to “/2”. That doesn’t happen.
I also looked into configuration packages but I didn’t really see how these would solve anything. By the way, what is the reason to expose different package stages when you cannot manually roll them back or anything?