Page 1 of 1

Disable Notification at the command-line?

Posted: Wed May 30, 2018 9:47 am
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?

Re: Disable Notification at the command-line?

Posted: Wed May 30, 2018 9:57 am
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

Re: Disable Notification at the command-line?

Posted: Wed May 30, 2018 12:55 pm
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

Re: Disable Notification at the command-line?

Posted: Thu May 31, 2018 10:17 am
by MrWoodward
Thanks, guys!

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

Much appreciated.

Re: Disable Notification at the command-line?

Posted: Thu May 31, 2018 10:36 am
by scottwilkerson
Glad to be of help. Let of know if you need further assistance