Using the Icinga Web API

by | Mar 12, 2021

Unfortunately, there is little to no documentation for using the Icinga Web API to perform monitoring actions such as scheduling downtimes. But it’s a simple thing and I’ll give you a quick example of how to do it. Using the Icinga Web API instead of the Icinga API gives you the advantages of the permission and restriction system, various authentication methods and auditing.

Icinga Web supports API access to all forms by simply adding the Accept: application/json header to the requests. In the following examples we plan downtimes for single and multiple hosts and services. The required fields for planning downtimes are the following:

  • type which is either fixed or flexible
  • start as UNIX timestamp
  • end as UNIX timestamp
  • comment

The following command creates a downtime for $hostname for the next hour.

curl -H "Accept: application/json" -u user:password \
"https://$server/icingaweb2/monitoring/host/schedule-downtime?host=$hostname" \
-F "type=fixed" \
-F "start=$(date +%s)" \
-F "end=$(expr $(date +%s) + 3600)" \
-F "comment=Reboot"

If you want to create downtimes for all services on this host as well, just add -F "all_services=1".

If you want to plan downtimes for multiple hosts, the URL looks like this:


$filter can be used from the multi-select or list views, e.g. hostgroup_name=test-servers or ((host_name=db1)|(host_name=db2)).

Scheduling service downtimes is done using the following URLs:



If you want to use the API for other monitoring commands, use your browser’s developer tools to see which URL is used by the relevant forms and what data they POST.

You can also find more how-tos at

You May Also Like…

Why you need network monitoring?

Why you need network monitoring?

Network monitoring is a continuous analysis of a network to detect and correct any performance issues. Network...

Icinga in the year 2021

Icinga in the year 2021

The year is coming to an end, this will be our last blogpost for this year too, abd a lot of people are already in the...

Subscribe to our Newsletter

A monthly digest of the latest Icinga news, releases, articles and community topics.