Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I try to monitor MySQL database:

[root@monitored.com ~]# su nagios -c /usr/lib/nagios/plugins/check_mysql Uptime: 18014 Threads: 1 Questions: 6 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.000

but I've got unexpected error:

[ec2-user@monitoring.com ~]$ /usr/lib/nagios/plugins/check_nrpe -H monitored.com -c check_mysql NRPE: Unable to read output

What's wrong?

share|improve this question
2  
One of the best things to try first is to run check_nrpe -H hostname to see if you get a version string back or the same error. If you get a version string, then a problem exists with the invocation of the plugin or the plugin itself. If you get the same error, then something is wrong with the nrpe configuration or Nagios's ability to talk to it. Also, tt's all too easy to forget to restart nrpe after making a config change - you'll want to make sure that's not the case here. –  Larold Sep 14 '11 at 19:47
    
Check the remote machine for selinux alerts with sealert -b –  user176592 Jun 5 '13 at 9:58
    
Confirm SELINUX is disabled at /etc/selinux/config. –  user204212 Jan 3 at 12:34
add comment

2 Answers 2

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.

share|improve this answer
add comment
up vote 2 down vote accepted

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

share|improve this answer
3  
I've never liked this excerpt from the NRPE documentation, because about 70% of the time I get this error, a condition is occurring which is not covered by any of the scenarios in the document. –  Larold Sep 14 '11 at 19:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.