Hi,
I have some cloud servers running that start and stop on demand. This is triggered by a script. This script now also adds or removes the downtime in Icinga for these hosts. And this does work as far as I can see. But when the host is still in downtime Icinga sends problem notifications via email.
My script works as follows:
Server shutdown:
Add downtime in Icinga
Shutdown the server
Server startup:
Start server
Remove downtime
Add new downtime with duration=2min (give it some time to start up)
Perhaps, you should use the API to check the host state first in icinga? then if the host is OK remove the DT ?
That way you dont have to add a 2 min downtime and keep it simple for you and the icinga host.
I still get notifications from services. I think I have read about notifications that will be send if the downtime started after the problem state. But what now? I can add and remove downtimes but I can not edit them. When I start the downtime I do not know how long it has to be.
You can try to start a down time in a flexible state instead of a fixed state before you shutdown the server. That way the downtime starts the moment the problem starts being there. and lasts for the amount of time you specify. see: