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?
Disable Notification at the command-line?
Re: Disable Notification at the command-line?
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
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
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?
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
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
-
MrWoodward
- Posts: 66
- Joined: Fri Jan 06, 2017 1:58 pm
Re: Disable Notification at the command-line?
Thanks, guys!
Both very useful. I've tried out the mass disable notification script and it seems to work well!
Much appreciated.
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?
Glad to be of help. Let of know if you need further assistance