Page 2 of 2

Re: Bulk Remove Scheduled Downtime

Posted: Fri Jul 26, 2024 9:36 am
by gregbeyer
Thank you, and applause!

Re: Bulk Remove Scheduled Downtime

Posted: Fri Jul 26, 2024 4:14 pm
by gregbeyer
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.

Re: Bulk Remove Scheduled Downtime

Posted: Mon Jul 29, 2024 7:46 am
by snapier3
bbahn wrote: Thu Jul 25, 2024 9:48 am Notice to those working on this here: Nagios XI will ship with a mass add/remove downtime feature in the next release!
So this is coming in 2024R1.1.6?

Re: Bulk Remove Scheduled Downtime

Posted: Mon Jul 29, 2024 9:43 am
by sgardil
snapier3 wrote: Mon Jul 29, 2024 7:46 am
bbahn wrote: Thu Jul 25, 2024 9:48 am Notice to those working on this here: Nagios XI will ship with a mass add/remove downtime feature in the next release!
So this is coming in 2024R1.1.6?
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

Posted: Tue Aug 13, 2024 11:08 am
by snapier3
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

Posted: Tue Aug 13, 2024 4:03 pm
by sgardil
snapier3 wrote: Tue Aug 13, 2024 11:08 am Looks like NagiosXI2024R1.2 dropped this morning. I will give the downtime management a whirl and see what's what.
Awesome, let us know how you feel about it and if it matches your needs.

Re: Bulk Remove Scheduled Downtime

Posted: Fri Oct 25, 2024 6:03 am
by mikedmt
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.

  • 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