Icinga DB Web Automation

by | Aug 7, 2025

Icinga DB Web Automation allows you to automate monitoring tasks and integrate them directly into your systems and workflows. It is possible to issue command actions without a browser. To do so, a form needs to be submitted by a tool such as cUrl.

Every request you send follows the same permission rules and access restrictions defined in the web interface, so security and user roles still apply.

Want to target specific hosts or services? Simply add filter parameters to the URL. If no filter is given, the command will apply to all available objects – so be precise!

You can also control the response:

  • Use the limit parameter to restrict how many results are returned.

  • Use the sort parameter to order the results the way you want.

The request must transmit the `Accept` HTTP header and set it to `application/json`. In addition to this, the request must be authenticated using the `Basic` schema.

What can you do with it?

Query Objects:

Retrieve details as json about hosts, services, downtimes, notifications, and more in real time.

# Fetch 5 hosts sorted by display_name
curl -i -u user:password -H "Accept: application/json" \
'http://localhost/icingaweb2/icingadb/hosts?limit=5&sort=host.display_name'
# Fetch 5 hosts sorted by display_name
python3 -c "import requests; \
url = 'http://localhost/icingaweb2/icingadb/hosts?limit=5&sort=host.display_name'; \
r = requests.post(url, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print('Status:', r.status_code); print('Body:', r.text)"

 

Acknowledge Problems:

Acknowledge hosts and services:

# Acknowledge hosts:
curl -H "Accept: application/json" -u user:password -X POST \
"http://localhost/icingaweb2/icingadb/hosts/acknowledge?host.name=switch-1" \
-F "comment=my comment"
# Acknowledge hosts:
python3 -c "import requests; \
url = 'http://localhost/icingaweb2/icingadb/hosts/acknowledge?host.name=switch-1'; \
data = {'comment': 'my comment'}; \
r = requests.post(url, data=data, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print('Status:', r.status_code); print(r.text)"

 

Remove the acknowledgement:

# Remove Acknowledgement:
curl -H "Accept: application/json" -u user:password -X POST \
"http://localhost/icingaweb2/icingadb/hosts/remove-acknowledgement?host.name=switch-1"
# Remove Acknowledgement:
python3 -c "import requests; \
url = 'http://localhost/icingaweb2/icingadb/hosts/remove-acknowledgement?host.name=switch-1'; \
r = requests.post(url, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print('Status:', r.status_code); print(r.text)"

 

Manage Downtimes:

Schedule downtimes for hosts and services:

# Schedule downtime for host "switch-1":
curl -H "Accept: application/json" -u user:password \
"http://localhost/icingaweb2/icingadb/hosts/schedule-downtime?host.name=switch-1" \
-F "type=fixed" \
-F "start=$(date "+%Y-%m-%dT%H:%M:%S")" \
-F "end=$(date -v+1H '+%Y-%m-%dT%H:%M:%S')" \
-F "comment=Maintenance"
# Schedule downtime for host "switch-1":
python3 -c "import requests, datetime; \
now = datetime.datetime.now(); \
end = now + datetime.timedelta(hours=1); \
url = 'http://localhost/icingaweb2/icingadb/hosts/schedule-downtime?host.name=switch-1'; \
data = { \
  'type': 'fixed', \
  'start': now.strftime('%Y-%m-%dT%H:%M:%S'), \
  'end': end.strftime('%Y-%m-%dT%H:%M:%S'), \
  'comment': 'RebootHostAandB' \
}; \
r = requests.post(url, data=data, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print(r.status_code); print(r.text);"

 

Remove the downtimes:

# Remove downtime by host name (This will remove all downtimes of host switch-1, use downtime.name filter to remove a specific downtime):
curl -H "Accept: application/json" -u user:password -X POST \
"http://localhost/icingaweb2/icingadb/downtimes/delete?host.name=switch-1"
# Remove downtime by host name (This will remove all downtimes of host switch-1, use downtime.name filter to remove a specific downtime):
python3 -c "import requests; \
url = 'http://localhost/icingaweb2/icingadb/downtimes/delete?host.name=switch-1'; \
r = requests.post(url, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print('Status:', r.status_code); print(response.text)"

 

Comments:

Add comments to hosts and services:

# Add a comment to a service "agent-check" of host "switch-1":
curl -H "Accept: application/json" -u user:password \
"http://localhost/icingaweb2/icingadb/services/add-comment?service.name=agent-check&host.name=switch-1" \
-F "comment=Testing"
# Add a comment to a service "agent-check" of host "switch-1":
python3 -c "import requests; \
url = 'http://localhost/icingaweb2/icingadb/services/add-comment?service.name=agent-check&host.name=switch-1'; \
data = {'comment': 'Testing'}; \
r = requests.post(url, data=data, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print('Status:', r.status_code); print(r.text)"

 

Remove comments:

# Remove comment of host "switch-1" (This will remove all comments of host "switch-1", use "comment.name" filter to remove a specific comment):
curl -H "Accept: application/json" -u user:password \
"http://localhost/icingaweb2/icingadb/comments/delete?host.name=switch-1"
# Remove comment of host "switch-1" (This will remove all comments of host "switch-1", use "comment.name" filter to remove a specific comment):
python3 -c "import requests; \
url = 'http://localhost/icingaweb2/icingadb/comments/delete?host.name=switch-1'; \
r = requests.post(url, headers={'Accept': 'application/json'}, auth=('user', 'password')); \
print('Status:', r.status_code); print(response.text)"

 

These are just a few examples, for a deeper dive into what’s possible, check out the official Icinga DB Web documentation.

You May Also Like…

Endpoint Monitoring with Icinga

Endpoint Monitoring with Icinga

Monitoring with Icinga primarily focuses on servers and infrastructure. But there are also the people operating these...

Subscribe to our Newsletter

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