Bulk Remove Scheduled Downtime
Re: Bulk Remove Scheduled Downtime
Thank you, and applause!
Re: Bulk Remove Scheduled Downtime
Found a way to delete timeouts in bulk using MySQL Workbench (https://www.mysql.com/products/workbench/). Or, if you're good at writing queries in mysql (I am not), do it that way.
A backup before doing the following on a PROD host would be well advised. 'Course you should be running nightly backups anyway.
Anyway, Timeouts are stored in the database "nagios", table "nagios _externalcommands", in the "command_args" column.
SELECT `command_args` FROM `nagios`.`nagios_externalcommands`; will list them. Then mass select the ones you want to delete, Delete, and Apply. IDK what the raw sql is for all of this, just telling what I did in MySQL Workbench. I also do not know what else may be stored in command_args by perhaps other Nagios XI tools or processes, besides downtimes. But that is all I found on my test server. So be careful what you select and delete. I would not recommend deleting everything in that column willy-nilly. You can ID Downtimes by the Comment string you (hopefully) entered when you created it.
This is what at Timeout looks like in the column: 'admin-coda;1722027883;1722035083;1;0;0;Gregory Beyer;Test downtime'
hostname;start;stop;fixed or flex,child host;associated services;who submitted;comment
After you've deleted what you want by way of MySQL or Workbench, cycle the nagios service. Timeouts are gone from the UI.
I hope this is helpful.
A backup before doing the following on a PROD host would be well advised. 'Course you should be running nightly backups anyway.
Anyway, Timeouts are stored in the database "nagios", table "nagios _externalcommands", in the "command_args" column.
SELECT `command_args` FROM `nagios`.`nagios_externalcommands`; will list them. Then mass select the ones you want to delete, Delete, and Apply. IDK what the raw sql is for all of this, just telling what I did in MySQL Workbench. I also do not know what else may be stored in command_args by perhaps other Nagios XI tools or processes, besides downtimes. But that is all I found on my test server. So be careful what you select and delete. I would not recommend deleting everything in that column willy-nilly. You can ID Downtimes by the Comment string you (hopefully) entered when you created it.
This is what at Timeout looks like in the column: 'admin-coda;1722027883;1722035083;1;0;0;Gregory Beyer;Test downtime'
hostname;start;stop;fixed or flex,child host;associated services;who submitted;comment
After you've deleted what you want by way of MySQL or Workbench, cycle the nagios service. Timeouts are gone from the UI.
I hope this is helpful.
Re: Bulk Remove Scheduled Downtime
In short, yes this is coming in the next release. The release will be a major release so it will be labeled as 2024R1.2
Re: Bulk Remove Scheduled Downtime
Looks like NagiosXI2024R1.2 dropped this morning. I will give the downtime management a whirl and see what's what.
Re: Bulk Remove Scheduled Downtime
Hi all,
I've created a bash script to overcome this and shared it here:
[https://github.com/mikedixson/useful-sh ... r-host.cmd]
It clears all service downtime for a host's services and for the host itself.
I've created a bash script to overcome this and shared it here:
[https://github.com/mikedixson/useful-sh ... r-host.cmd]
It clears all service downtime for a host's services and for the host itself.
- The user you run it as will need to be in the www-data group as that has permission on the nagios.cmd pipe file.
- Check External commands also needs to be enabled in your nagios config: check_external_commands=1