NRPE: Unable to read output
Solution 1:
One good way to debug why the command being executed is not returning any valid output is to use strace
. For example, I just had a problem running the check_linux_raid command via NRPE.
Run strace -f -p <nrpe pid>
, and then execute the command manually from the system running nagios (e.g. /usr/lib64/nagios/plugins/check_nrpe -H remotename -c commandname -a arg1 arg2 ...
).
Scan the output of strace for errors, such as permission denied or other similar errors that may occur. For example, in my case, selinux was denying permission to a file when running from the remote machine, even though that user has local access to that file.
Solution 2:
From Nagios NRPE Documentation:
The check_nrpe plugin returns "NRPE: Unable to read output"
This error indicates that the command that was run by the NRPE daemon did not return any character output. This could be an indication of the following problems:
– An incorrectly defined command line in the command definition. Verify that the command definition in your NRPE configuration file is correct.
– The plugin that is specified in the command line is malfunctioning. Run the command line manually to make sure the plugin returns some kind of text output.
More details here http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf