Page 1 of 1

Automate disable notifications from script

Posted: Sun Aug 11, 2013 3:50 pm
by reincarne
Hi, I really hope someone will find a solution for me as it very important for me.
I would like to automate some processes in my deployments. Let's say I have a specific VB script on wind server which does specific actions.
I want that VB script disable notifications for a specific host to avoid faulty alerts.
is it possible to disable notifications from a sciprt for a specific host?
is it possible to disable notifications from a sciprt for all the hosts?


Thanks in advance.

Re: Automate disable notifications from script

Posted: Mon Aug 12, 2013 9:57 am
by sreinhardt
In the sense that you can filter what you send back to nagios, or request the url in the nagios interface that would disable notifications, yes. However it is not generally supported that a plugin would tell the nagios system to disable notifications, this would have to be via the webui from an external system.

Re: Automate disable notifications from script

Posted: Wed Oct 02, 2013 5:32 am
by reincarne
I managed to do that but it requires some additional permissions.
I will share it so maybe other people will need it.
The command that I run from the CMD to disable/enable notifications is:

curl -d "cmd_mod=2&cmd_typ=12" "http://[YOUR ADDRESS]/nagios/cgi-bin/cmd.cgi" -u "[YOUR USERNAME]"

Once you hit Enter, you will be asked to enter your password. Note the the username is for the Web UI and not for the linux machine.

cmd_typ=12 ==> Enable notifications.
cmd_typ=11 ==> Disable notifications.

Re: Automate disable notifications from script

Posted: Wed Oct 02, 2013 9:23 am
by scottwilkerson
Thanks for sharing your solution!