I have created a check plug-in using bash shell…
I don’t know how to process the return_code thus nagios can recognize warning and critical status.
I have created a check plug-in using bash shell…
I don’t know how to process the return_code thus nagios can recognize warning and critical status.
Ok. Eventually i found the answer to this problem.
Just write the exit 0 , 1 or 2 at the end of IF
Or, if you source $NAGIOS-HOME/libexec/utils.sh you can use the following variables as your exit codes:
$STATE_OK
$STATE_WARNING
$STATE_CRITICAL
Reading through other people’s plugins can be really educational
Oh! Be sure to upload your check script to www.nagiosexchange.org. Other people might appreciate your script as well!