[Nagiosplug-devel] Writing a new plugin, having a strange bug.

Jason Martin jhmartin at toger.us
Fri Sep 19 05:51:10 CEST 2008


On Thu, Sep 18, 2008 at 04:21:43PM -0500, Jason Reynolds wrote:
> simply that when my plugin's return code is 1, 2, or 3, Nagios still shows
> the service as "OK".  I have verified the plugin's
> return code by executing it myself, then using echo $? from the command
> line, showing the return code.
Please post your command definition, including NRPE
configuratino for same.  It sounds like you aren't executing the
plugin you think you are, or there is a wrapper that is losing
the return code somewhere along the way.

Common example:

#!/bin/sh
check_http ....

if [ $? -ne 0 ]; then
	echo oh no!
fi

The above always returns 0 since the script will end up
returning the exit code of echo if $? is not 0.  It is good that
you are checking $? while testing the plugin, so it sounds like
it is something upstream of it.

-- 
This message is PGP/MIME signed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 219 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20080918/8d5574cd/attachment.sig>


More information about the Devel mailing list