CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Testing check_nrpe from nagios server to one of our nrpe hosts..
[18:36][root@ops /etc/nagios/hosts]# /usr/lib64/nagios/plugins/check_nrpe -H 192.XXX.XX.XX -c check_disk -a 60 80 / CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
As we can see (first image), nagios server can see/ping the nrpe host…
Taking a look of my logs at the nrpe host located at
- ubuntu – /var/log/syslog
- centos – /var/log/messages
Oct 20 14:51:56 ubuntu-512mb-nyc1-01 nrpe[17097]: Error: Request contained command arguments! Oct 20 14:51:56 ubuntu-512mb-nyc1-01 nrpe[17097]: Client request was invalid, bailing out...
This means that nrpe isn’t configured to allow command arguments.
Some possible ways to fix it!..
POSSIBLE SOLUTION Nº 1
Matt Yakel said that he had to add the following line to to the /etc/services
nrpe 5666/tcp # nrpe
Mine already had it so…. this wasn’t my problem.
POSSIBLE SOLUTION Nº 2
WELL!, since this was taking to long!
I decided to make the request without passing arguments from the server to the host.
This way, we can have dont_blame_nrpe=0.
Like *everyone* else uses, I’v defined check_nrpe_1arg command on my nagios server on file /etc/nagios/objects/commands.cfg.
Edit
nano /etc/nagios/objects/commands.cfg
Add the following lines to it
define command{ command_name check_nrpe_1arg command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -C $ARG1$ }
Now, on the file of the desired host configuration file (/etc/nagios/hosts/), lets replace check_nrpe for check_nrpe_1arg and remove the arguments.
Example
define service { use generic-service host_name sdxxx.host.com service_description DISK: root partition check_command check_nrpe_1arg!check_disk }
On nagios nrpe host, on nrpe.cfg we need to use the hardcoded command arguments.
Example
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10 command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p / command[check_procs]=/usr/lib/nagios/plugins/check_procs -w 300 -c 500 -s RSZDT command[check_apt]=/usr/lib/nagios/plugins/check_apt
This possible solution worked for me. 🙂