Page 1 of 1

Scheduled Downtime Cancel

Posted: Fri Nov 23, 2018 6:27 am
by charlie126
Hi,

Is it possible to cancel/delete scheduled downtime in bulk rather then having to delete them individually from the downtime option on the Nagios webportal?

Kind regards,

Re: Scheduled Downtime Cancel

Posted: Mon Nov 26, 2018 9:43 am
by mcapra
You could probably script something out using the external commands file and JSON CGIs:
https://assets.nagios.com/downloads/nag ... ernalcmds/
https://labs.nagios.com/2014/06/19/expl ... -7-part-1/

Else, there's a few related feature requests you may want to chime in on:
https://github.com/NagiosEnterprises/na ... issues/338
https://github.com/NagiosEnterprises/na ... issues/279

Re: Scheduled Downtime Cancel

Posted: Mon Nov 26, 2018 5:57 pm
by npolovenko
@charlie126, I was able to remove all downtime by deleting hostcomment and hostdowntime blocks (for host downtime), and servicecomment and servicedowntime blocks for the service downtime from the /usr/local/nagios/var/retention.dat file.
So you'd stop the nagios process, make changes to the retention.dat file and then start the nagios process. To take this one step further you could come up with a script that would strip the retention file from these blocks automatically.