Bulk Remove Scheduled Downtime

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gregbeyer
Posts: 181
Joined: Fri Sep 11, 2020 2:13 pm

Re: Bulk Remove Scheduled Downtime

Post by gregbeyer »

Thank you, and applause!
gregbeyer
Posts: 181
Joined: Fri Sep 11, 2020 2:13 pm

Re: Bulk Remove Scheduled Downtime

Post 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.
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: Bulk Remove Scheduled Downtime

Post 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?
sgardil
Posts: 355
Joined: Wed Aug 09, 2023 9:58 am

Re: Bulk Remove Scheduled Downtime

Post 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
snapier3
Posts: 144
Joined: Tue Apr 23, 2019 7:12 pm

Re: Bulk Remove Scheduled Downtime

Post by snapier3 »

Looks like NagiosXI2024R1.2 dropped this morning. I will give the downtime management a whirl and see what's what.
sgardil
Posts: 355
Joined: Wed Aug 09, 2023 9:58 am

Re: Bulk Remove Scheduled Downtime

Post 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.
mikedmt
Posts: 1
Joined: Wed Sep 04, 2019 4:49 am

Re: Bulk Remove Scheduled Downtime

Post 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
Post Reply