Disable / Enable Nagios notifications from command line

Your a lazy devops, you want to deploy your application in one click BUT you don’t want Nagios to send alerts while you’re deploying. Solution: disable Nagios notifications while deploying.

  • Disable Nagios Notifications:

    curl -d "cmd_mod=2&cmd_typ=11" "http://NAGIOS_HOST/cgi-bin/nagios3/cmd.cgi" -u "USERNAME:PASSWORD"

  • Re-Enable Nagios Notifications:

    curl -d "cmd_mod=2&cmd_typ=12" "http://NAGIOS_HOST/cgi-bin/nagios3/cmd.cgi" -u "USERNAME:PASSWORD"

Post to Twitter

. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Posted June 21, 2012 at 14:20 | Permalink

    I’m trying this but keep running into an error, no matter how I attempt to go about this. My cmd.cgi file is actually in /usr/local/nagios/sbin/ but every time I try to pass this command with the directory changed to that, it just errors out stating that the requested url /usr/local/nagios/sbin/cmd.cgi was not found on the server.

    Any idea what might be causing this problem?

  2. BaconBoy
    Posted July 5, 2012 at 13:49 | Permalink

    Your url is incorrect.
    Your webserver should be aliasing the /cgi-bin to where the actual path lies.

  3. Sudheer
    Posted September 12, 2012 at 18:20 | Permalink

    I disabled the notifications on Nagios due to the activity but, still i’m getting mail alerts. Can you help me to resolve this issue?

    Thanks in Advance.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>