Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
Checks the status, or exit, code of another program and returns a Nagios status code based on the result. This is basically the official negate plug-in but rewritten in bash so it will run in heterogenous unix environments.
Useful in cases where a program returns an odd status code such as > 3. If say, your program returns 127 and that means OK, we tell that to check_status_code.sh which will then return the proper Nagios exit code e.g. 1 (OK).
Current Version
Last Release Date
2014-02-17
Owner
Jon Schipp
Download URL
https://github.com/jonschipp/nagios-plugins/blob/master/negate.sh
Compatible With
Checks the status, or exit, code of another program and returns a Nagios status code based on the result. Options: -r Absolute path of program to run, use quotes for options -o Status to expect for OK state (def: 0) -w Status to expect for WARNING state (def: 1) -c Status to expect for CRITICAL state (def: 2) -u Status to expect for UNKNOWN state (def: 3) Usage: $0 -r "/usr/sbin/service sshd status" # Author: Jon Schipp ######## # Examples: # 1.) Check status code for uptime using the defaults # $ ./negate.sh -r /usr/bin/uptime # # 2.) Custom service does it backwards and exits 1 when running and 0 when stopped. The proper status code gets returned to Nagios. # $ ./negate.sh -r "/usr/sbin/service custom-server status" -o 1 -c 0
You must be logged in to submit a review.
To:
From: