Create new downtime and trigger all services

Hi,

I have a question how icingaweb2 handle the creation of downtimes if the option “all services” is also checked.

The background is following:
We handle internal maintenance work through a CMDB. That means everybody register there planned work there. From here I import this with a perl script through the Icinga-API. This is the Sub routine


Last time a colleague planned also a maintenance and the downtime was correctly imported and the downtime started correctly for the host. But the services was critical without downtime.
Here is the difference to icingaweb2. When somebody is planning a downtime via icingaweb2 and check the option “all Service” the downtime is also triggered to the Service.

So how icingaweb2 handle this? I didn’t find the correct source on github.

At the end this means to me:

  • I change my script in the way like icingaweb2 creates downtimes, so I have to know how it workes there.
  • I create a Feature-request on GitHub to have also a parameter for the icinga2-API.

Thank you

cheers

Hi,

it works by use of another command but with a filter attached. You can find Web 2’s implementation here:

1 Like

thanks for the link to the source. So I will do the same in my perl script.

Basically the filter sums up to host.name=="HOST" with the type Service. More details can be found inside the Icinga 2 REST API docs.

Cheers,
Michael

thanks Michael.
After I saw the source and the API doc, everything was clear :slight_smile:
It’s a simple change in my script.
I was a little bit confused because I saw in the icinga2.log only one API request from icingaweb2.

1 Like

Hi,

yeah, the filter expressions make it more easy to just send one HTTP request instead of many. Be careful though with filters affecting all objects - always test them inside a GET request first before half of your production gets a downtime scheduled :wink:

Cheers,
Michael