check_memory nrpe Unable to read output
Posted: Wed Jul 08, 2015 4:37 pm
Folks, I'm having a bit of an issue getting nrpe to work with one of my servers. I have CentOS 6.6, I downloaded a check_mem file, which I've attahced. I uploaded this file to everyone of my servers, centos and ubuntu and it worked fine. I've added the file to /usr/lib64/nagios/plugins and made the following changes in the configs "/etc/nagios/nrpe.cfg" for all nagios client servers. This configuration has worked on multiple CentOS servers without an issue, I've tried everything, scavenged through dozen of articles, forums and no avail. The memory command /usr/lib64/nagios/plugins/check_mem -f -w 20 -c 10 works great when run locally in the client but not from the server to the client...
Client Side:
I have the following location and permissions for this file:
Added nrpe 5666/tcp #NRPE into the /etc/services file, the following is the debug printed out on the client side for the nrpe.
Server Side:
I can run any command from the server to client for ex. "/usr/lib64/nagios/plugins/check_nrpe -H client ip -c check_drive" and gives the expected response.
I've added the following to the command.cfg & the server.cfg, which works great.
server.cfg
I've done the same for the memory, but won't work.
Running the command from the local client side:
When I run the commands from the command line from the server side I get
Please help.. It's kind of annoying that it worked on every server except one!!
Client Side:
I have the following location and permissions for this file:
Code: Select all
[root@management ~]# ls -l /usr/lib64/nagios/plugins/check_mem
-rwxr-xr-x. 1 root root 12330 Jul 7 18:21 /usr/lib64/nagios/plugins/check_mem
Code: Select all
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=Nagios monitor server IP
dont_blame_nrpe=1
command[check_drive]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda
command[check_memory]=/usr/lib64/nagios/plugins/check_mem -f -w 30 -c 10
Code: Select all
Allowing connections from: xx.xx.xx.xx
Jul 8 14:37:16 api nrpe[1835]: Connection from xx.xx.xx.xx port 5784
Jul 8 14:37:16 api nrpe[1835]: Host address is in allowed_hosts
Jul 8 14:37:16 api nrpe[1835]: Handling the connection...
Jul 8 14:37:16 api nrpe[1835]: Host is asking for command 'check_memory' to be run...
Jul 8 14:37:16 api nrpe[1835]: Running command: /usr/lib64/nagios/plugins/check_mem -f -w 20 -c 10
Jul 8 14:37:16 api nrpe[1835]: Command completed with return code 3 and output:
Jul 8 14:37:16 api nrpe[1835]: Return Code: 3, Output: NRPE: Unable to read output
Jul 8 14:37:16 api nrpe[1835]: Connection from pÃ}<9c>ÿ#177 closed.
I can run any command from the server to client for ex. "/usr/lib64/nagios/plugins/check_nrpe -H client ip -c check_drive" and gives the expected response.
I've added the following to the command.cfg & the server.cfg, which works great.
Code: Select all
define command{
command_name check_space
command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_drive
}
Code: Select all
define service{
use generic-service
host_name api-webserver
service_description Root Partition
check_command check_space
}
Code: Select all
define command{
command_name check_memori
command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_memory
}
define service{
use generic-service
host_name api-webserver
service_description Memory
check_command check_memori
}
Code: Select all
[root@api ~]# /usr/lib64/nagios/plugins/check_mem -f -w 20 -c 5
OK - 84.2% (6785808 kB) free.|TOTAL=8059740KB;;;; USED=1273932KB;6447792;7656753;; FREE=6785808KB;;;; CACHES=1024644KB;;;;
Code: Select all
[root@management ~]# /usr/lib64/nagios/plugins/check_nrpe -H 192.168.0.19 -c check_drive
DISK OK - free space: / 11463 MB (86% inode=94%);| /=1716MB;11113;12502;0;13892
[root@management ~]/usr/lib64/nagios/plugins/check_nrpe -H 192.168.0.19 -c check_memory
NRPE: Unable to read output