Disable Notification at the command-line?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
MrWoodward
Posts: 66
Joined: Fri Jan 06, 2017 1:58 pm

Disable Notification at the command-line?

Post by MrWoodward »

Is there a way to "Disable Notification" at the command-line in an instantaneous manner?

Sometimes we find that when load is high on the Nagios box, that clicking "Disable Notification" either thru XI or Core is very slow to respond, or doesn't respond at all.

Is there a command-line version of "Disable Notification" that works right away?
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Disable Notification at the command-line?

Post by eloyd »

Yes. You can use the nagios.cmd pipe file to execute the appropriate command (see https://assets.nagios.com/downloads/nag ... mands.html).

I'm guessing you're most interested in https://old.nagios.org/developerinfo/ex ... mand_id=12

Code: Select all

#!/bin/sh
# This is a sample shell script showing how you can submit the DISABLE_SVC_NOTIFICATIONS command
# to Nagios.  Adjust variables to fit your environment as necessary.

now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'

/bin/printf "[%lu] DISABLE_SVC_NOTIFICATIONS;host1;service1\n" $now > $commandfile
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Disable Notification at the command-line?

Post by scottwilkerson »

Thanks eloyd

If you were looking for the system wide version it is here
https://old.nagios.org/developerinfo/ex ... mmand_id=7

A full list of commands are available here
https://old.nagios.org/developerinfo/ex ... ndlist.php
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MrWoodward
Posts: 66
Joined: Fri Jan 06, 2017 1:58 pm

Re: Disable Notification at the command-line?

Post by MrWoodward »

Thanks, guys!

Both very useful. I've tried out the mass disable notification script and it seems to work well!

Much appreciated.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Disable Notification at the command-line?

Post by scottwilkerson »

Glad to be of help. Let of know if you need further assistance
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked