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.
Automate disable notifications from script
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Automate disable notifications from script
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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Automate disable notifications from script
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Automate disable notifications from script
Thanks for sharing your solution!