I just configured Nagios monitoring on two RHEL 6 servers. Everything works fine except the CPU and Mem monitors on both. I got 'NRPE: Unable to read output' error. Same check_nrpe works for other monitors like disks, etc.
This is the command Nagios uses:
/usr/local/nagios/libexec/check_nrpe -H 172.20.60.143 -t 30 -c check_cpu_stats -a '-w 90 -c 95'
Result:
NRPE: Unable to read output
NRPE: Unable to read output
Re: NRPE: Unable to read output
This error implies that NRPE did not return any character output. Common causes are incorrect plugin paths in the nrpe.cfg file or that
the remote host does not have NRPE installed. There are also cases where the wrong interpreter is invoked when running the remote
plugin. Rarely, it is caused by trying to run a plugin that requires root privileges.
Take a look the NRPE troubleshooting guide for more details.
https://assets.nagios.com/downloads/nag ... utions.pdf
If the above doesn't help, can you post your nrep.cfg file from the remote host so we can view it?
the remote host does not have NRPE installed. There are also cases where the wrong interpreter is invoked when running the remote
plugin. Rarely, it is caused by trying to run a plugin that requires root privileges.
Take a look the NRPE troubleshooting guide for more details.
https://assets.nagios.com/downloads/nag ... utions.pdf
If the above doesn't help, can you post your nrep.cfg file from the remote host so we can view it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE: Unable to read output
The guide is for check_nrpe not working at all. But in my case, for the same client, Other check_nrpe work but not for CPU/Mem.
COMMAND: /usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_load -a '-w 15,10,5 -c 30,20,10'
OK - load average: 0.79, 0.69, 0.54|load1=0.790;15.000;30.000;0; load5=0.690;10.000;20.000;0; load15=0.540;5.000;10.000;0;
/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_disk -a '-w 20% -c 10% -p /'
DISK OK - free space: / 3107 MB (84% inode=94%);| /=591MB;3122;3512;0;3903
/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_cpu_stats -a '-w 90 -c 95'
NRPE: Unable to read output
/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_mem -a '-w 90 -c 95'
NRPE: Unable to read output
COMMAND: /usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_load -a '-w 15,10,5 -c 30,20,10'
OK - load average: 0.79, 0.69, 0.54|load1=0.790;15.000;30.000;0; load5=0.690;10.000;20.000;0; load15=0.540;5.000;10.000;0;
/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_disk -a '-w 20% -c 10% -p /'
DISK OK - free space: / 3107 MB (84% inode=94%);| /=591MB;3122;3512;0;3903
/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_cpu_stats -a '-w 90 -c 95'
NRPE: Unable to read output
/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_mem -a '-w 90 -c 95'
NRPE: Unable to read output
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: NRPE: Unable to read output
On the remote host as root run:w-bao wrote:/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_mem -a '-w 90 -c 95'
NRPE: Unable to read output
Code: Select all
chown nagios:nagios /usr/local/nagios/libexec/custom_check_memCode: Select all
check_nrpe -H rhel02 -c check_mem -a '-w 10 -c 5'
OK - 892 / 996 MB (89%) Free Memory, Used: 181 MB, Shared: 0 MB, Buffers: 8 MB, Cached: 77 MB | total=996MB free=892MB used=181MB shared=0MB buffers=8MB cached=77MBOn the remote host as root run:w-bao wrote:/usr/local/nagios/libexec/check_nrpe -H vm-nesvscan1-tts -t 30 -c check_cpu_stats -a '-w 90 -c 95'
NRPE: Unable to read output
Code: Select all
chown nagios:nagios /usr/local/nagios/libexec/check_cpu_stats.shAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NRPE: Unable to read output
That fixed the memory check issue. I did the same thing to check_cpu_stats.sh and it fixed the CPU issue. Interesting.
Just curious, how come the default setting works on other RHEL 6 clients? And how come other checks like check_disk, check_load work with root ownership on the same client?
Just curious, how come the default setting works on other RHEL 6 clients? And how come other checks like check_disk, check_load work with root ownership on the same client?
Re: NRPE: Unable to read output
It really all depends on how each plugin is gaining it's information that it sets as variables. Some will use commands that can run without any issues not under root, while some have one single function that is dependent on being able to have rights in the sudoers. With your case though, it sounds like comparable files might have had a read flag on the 'other' section, so the ownership wasn't needed, while this one may have been a read flag for 'other'.
Former Nagios Employee
Re: NRPE: Unable to read output
OK. thank you!
Re: NRPE: Unable to read output
Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/