nrpe: fails when check command outputs to stderr

Simon Kitching simon at ecnetwork.co.nz
Mon Dec 22 22:47:37 CET 2003


Hi,

I have been having some problems with "check_nrpe" reporting:
  CHECK_NRPE: Response packet had invalid CRC32.

I believe I have located the cause of the problem, which is as
follows...

When the nrpe app forks a child and calls popen(...) to execute the
target command, the STDERR filedescriptor isn't overridden. Therefore if
the target command ever outputs data to STDERR, that goes via the
inherited STDERR: straight back across the socket to the check_nrpe
process! Only *later* does the nrpe process send the packet version,
checksum, and message. The result is obvious: check_nrpe looks for the
checksum but finds only the STDERR output from the check command and so
reports "invalid CRC32".

It should be simple to duplicate this problem: a shellscript which
prints to STDERR should do the trick I think.

I have fixed this by ensuring my (custom) check command suppresses all
STDERR output, but I think it would be nice to fix this in nrpe as the
error message is difficult to understand. Perhaps also an FAQ entry
would be good for this?

If you don't have time to look into this, but would be willing to look
at a patch for nrpe.c then please let me know and I will prepare one.

Thanks for some great software!

Regards,

Simon



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list