Downtime: delete all downtimes of a host and its service via icingadb api withouth the need to address individual downtime guids
Is your feature request related to a problem? Please describe.
Today we use the monitoring-module's api to schedule and remove downtimes for hosts and their services on demand in automated ways. The old monitoring module handles the removal in the following way:
../icingaweb2/monitoring/downtimes/delete-all?host_name=<hostname>
If I want to do this with icingadb, it's api call references multiple downtimes, combined with their individual guids:
Describe the solution you'd like
Is it possible to remove all downtimes for a host an it's services with icingadb's api without the need to adress these guids? Something like:
../icingaweb2/icingadb/downtimes/delete-all?name=<hostname>
Additional context
This issues forces us to keep the old monitoring module activated in the background.
Thank you very much for the quick fix 🥇
It's not merged yet ;)
Sorry, I was too euphoric 🙈 We are using the fix already
Hello again!
Out user also whish for a way to remove downtimes for individulal services. The usage of /icingaweb2/icingadb/downtimes/delete?host.name=<hostname> to remove them all is in some cases too much on an sledgehammer approach, where users need to remove only individual downtimes one after another.
Could you expand the functionality? Something like /icingaweb2/icingadb/downtimes/delete?service.name=<hostname>!<servicename> whould be helpful.
If I'm not mistaken, the linked pull request allows to pass any filter the comment/downtime list also accepts. If you search there for the downtimes you want to remove and use the same filter for the automation endpoint, it should affect only those you saw in the list as well.
This approach works, but unfortunately you need to know the individual guid of every single service downtime, which is hidden knowledge outside of icinga. Also I expect the guid to be ever changing.
/icingaweb2/icingadb/downtimes/delete?name=<host_name>%21<service_name>%21<individual_guid>
{"status":"success","data":[{"type":"success","message":"Removed downtime successfully"}]}
The users only know their host- and the service-names. With knowledge of the known facts alone I am unable to delete a service downtime:
/icingaweb2/icingadb/downtimes/delete?name=<host_name>%21<service_name>
{"status":"error","message":"No command targets found"}
Am I maybe doing things wrong?
Try /icingaweb2/icingadb/downtimes/delete?host.name=<host-name>&service.name=<service_name>. With any filter, I meant any filter ;)
Thank you so much for clarification!