Unable to select many hosts at once

Hi all!

Due to maintenance of our Telekom connection, we need to create a Downtime for almost all hosts in our Icinga2 (2.10.3-2 from Debian 10 repositories).
Unfortunately, if I try to select all these hosts (about 200) I get the error “The connection to the Icinga web server was lost at 2021-01-26 12:49”
I tried with Firefox and Chrome and I always get the error…

If I try to check what Icingaweb sends to the server I see a huge HTTP-query with all the hosts. The query will not be sent to the server, or at least I cannot find it in Apache-Log.

Could someone help me to solve the problem, or at least suggest me a way to create a Downtime for many (hundreds) hosts at once?

Thanks a lot
Luca

Hi

you can try to schedule the downtime via API.

Kind regards

1 Like

I would recommend the API for this.

https://icinga.com/docs/icinga-2/latest/doc/12-icinga2-api/#schedule-downtime

Antony.

1 Like

You are probably running into the url length limit of your webserver with such a query. Icinga 2’s API is the better approach with such big bulk operations :slight_smile:

1 Like

Hi and thank you very much for your answer!
Indeed I think, too, I reached the limit for the Apache query length.

I’ll try with the API!

Thanks
Luca

Hi,

I tried with the API.
This is my call:

curl -k -s -u user:pass -H 'Accept: application/json' \
 -X POST 'https://master.domain.tld:5665/v1/actions/schedule-downtime' \
 -d "$(jo -p pretty=true type=Host filter="match(\"hudsoncsharp*\", host.name)" \
 all_services=true author=user comment="TEST" \
 fixed=true start_time=$(date "+%s" -d "01/27/2021 16:30:00") end_time=$(date "+%s" -d "01/27/2021 16:35:00"))"

It works, the downtimes are created, but just for the Hosts. A downtime for the services will not created.
Could you explain me where is my error?

Thanks
Luca

I just tried your call in my test environment and it works for the host and its services. I had to adjust the time though, because 01/27/2021 16:35:00 was in the past for me. What did the results look like?