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…

Icinga Camp Berlin 2023

It’s time to spread some monitoring love! We’re super happy to announce our next Icinga Camp in Berlin, on May 17th, 2023

How Tenacta Group uses Icinga

How Tenacta Group uses Icinga

This is a blogpost from Livio Daina from Tenacta Group Tenacta Group is an Italian company with a portfolio of...

Subscribe to our Newsletter

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