Re: Problems using check_nrpe
Posted: Thu Dec 09, 2010 1:18 pm
OH, I got it now. You have a '|' in your plugin output. Nagios interprets interprets plugin output this way:
<output message with some sort of exit code (0-3)> | <performance data for graphing>
The exit code from the check script must exit with a numeric value (0-3) in order for Nagios to read it correctly. In the code it will look something like :
Nagios is interpreting the check as "OK" because it's looking for that return code, but if it gets something else it shows up as FALSE (which is also 0) in most programming languages. So even though you're getting the text output the way you want it, Nagios is not finding the exit code.
Are you intending for the following data to be graphed?
Does that make sense?
<output message with some sort of exit code (0-3)> | <performance data for graphing>
The exit code from the check script must exit with a numeric value (0-3) in order for Nagios to read it correctly. In the code it will look something like :
Code: Select all
exit(0) //if state is OK
exit(1) //if state is warning
exit(2) //if state is critical
exit(3) //if state is unknownAre you intending for the following data to be graphed?
If not, you need to remove the '|' as part of your plugin output.'aw-test.txt'=1;0;1;
Does that make sense?