Page 1 of 1

CHECK_NRPE: Error receiving data from daemon

Posted: Tue May 13, 2014 12:55 pm
by cshaffer
Hello. I have been working with Nagios Xi for a short time. I am trying to setup monitoring of our ERP system and I am running into a problem when I try running a check_disk command. Here are the software versions.
Server OS: centos:linux:6:GA
Client Host OS: RHEL 4
libmcrypt-2.5.0.52-49.ent.src.rpm
linux-nrpe-agent-el4

NRPE seems to work OK.
From the client: check_nrpe -H localhost returns NRPE v2.12
From the server: ./check_nrpe -H 10.206.201.25 returns NRPE v2.12

The check_disk command seems to work OK on the client: check_disk -w 20% -c 10% returns DISK OK - free space / 21211 MB (69% inode=96%); ...... etc.

But when I try to run the check_disk command with the check_nrpe command on the client check_nrpe -H localhost check_disk -a '-w 20% -c 10% -p /' -n
I get the error message: CHECK_NRPE: Error receiving data from daemon.

When I check the /var/log/messages file on the client I see:
May 7 15:50:45 trans4m nrpe[30987]: Error: Could not complete SSL handshake. 1

I thought that the -n option on the check_nrpe command told nrpe to not use SSL. So why is it complaining about an incomplete SSL handshake?

Any help would be greatly appreciated.

Re: CHECK_NRPE: Error receiving data from daemon

Posted: Tue May 13, 2014 5:56 pm
by slansing
You need to define the host address for the remote host, as well as (-c) for the check command, like so:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H remote.host.addr. -c check_disk -a '-w 20% -c 10% -p /' -n
Or depending on if you are using SSL or not:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H remote.host.addr. -c check_disk -a '-w 20% -c 10% -p /'

Re: CHECK_NRPE: Error receiving data from daemon

Posted: Wed May 14, 2014 8:07 am
by cshaffer
I am testing this logged in to the client as nagios. I have set a path to the check_nrpe command directory for nagios so I ran this command

check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /' -n (I think I was using the -c option before, but missed it when I submitted the question)

Still got the CHECK_NRPE: Error receiving data from daemon.
Checked the /var/log/messages file with a tail and see Error: Could not complete SSL handshake. 1

If I try the command without the -n option I get the error NRPE: Unable to read output
But the error in the /var/log/messages is still Could not complete SSL handshake.

Am I misunderstanding the -n option? I am thinking that it should tell check_nrpe not to try and use SSL. I thought that using nrpe made it unnecessary to use SSL.

Re: CHECK_NRPE: Error receiving data from daemon

Posted: Wed May 14, 2014 3:08 pm
by lmiltchev
How is the "check_disk" command defined on the remote box?

Re: CHECK_NRPE: Error receiving data from daemon

Posted: Thu May 15, 2014 9:11 am
by cshaffer
There is a non-text file in /usr/local/nagios/libexec.
-bash-3.00# ls -al check_disk
-rwxr-xr-x 1 nagios nagios 280566 May 6 15:19 check_disk

I can run it with no problem.
bash-3.00# ./check_disk -w 20% -c 10%
ISK OK - free space: / 20998 MB (68% inode=96%); /NTN 25722 MB (39% inode=94%); /boot 83 MB (88% inode=99%); /dev/shm 1013 MB (100%
inode=99%);| /=9533MB;25732;28948;0;32165 /NTN=39167MB;54689;61525;0;68362 /boot=10MB;78;88;0;98 /dev/shm=0MB;810;911;0;1013

The problem occurs when I run it through the check_nrpe command.
-bash-3.00# ./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10%' -n
CHECK_NRPE: Error receiving data from daemon.

The system logs say
-bash-3.00# tail /var/log/messages
May 15 09:08:06 trans4m nrpe[11116]: Error: Could not complete SSL handshake. 1
May 15 09:08:08 trans4m nrpe[11122]: Error: Could not complete SSL handshake. 1
May 15 09:08:17 trans4m nrpe[11155]: Error: Could not complete SSL handshake. 1
May 15 09:08:17 trans4m nrpe[11156]: Error: Could not complete SSL handshake. 1
May 15 09:08:27 trans4m nrpe[11185]: Error: Could not complete SSL handshake. 1
May 15 09:08:58 trans4m nrpe[11233]: Error: Could not complete SSL handshake. 1
May 15 09:08:59 trans4m nrpe[11238]: Error: Could not complete SSL handshake. 1
May 15 09:09:37 trans4m nrpe[11335]: Error: Could not complete SSL handshake. 1

I thought that the -n option made SSL unnecessary?

Re: CHECK_NRPE: Error receiving data from daemon

Posted: Thu May 15, 2014 10:10 am
by cshaffer
Checked the /usr/local/nagios/etc/
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

Made sure that the allowed_hosts in /usr/local/nagios/etc/nrpe.cfg contained the localhost and the server.

Made sure that the only_from line in the /etc/xinetd.d/nrpe file includes the localhost and the server.

Tried it again and got the same result.
-bash-3.00# ./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10%' -n
CHECK_NRPE: Error receiving data from daemon.
-bash-3.00# tail /var/log/messages
May 15 10:07:06 trans4m snmpd[2420]: transport socket = 12
May 15 10:07:09 trans4m nrpe[21056]: Error: Could not complete SSL handshake. 1
May 15 10:08:06 trans4m nrpe[21200]: Error: Could not complete SSL handshake. 1
May 15 10:08:08 trans4m nrpe[21201]: Error: Could not complete SSL handshake. 1
May 15 10:08:13 trans4m nrpe[21204]: Error: Could not complete SSL handshake. 1
May 15 10:08:17 trans4m nrpe[21222]: Error: Could not complete SSL handshake. 1
May 15 10:08:17 trans4m nrpe[21224]: Error: Could not complete SSL handshake. 1
May 15 10:08:27 trans4m nrpe[21256]: Error: Could not complete SSL handshake. 1

Re: CHECK_NRPE: Error receiving data from daemon

Posted: Thu May 15, 2014 4:10 pm
by tmcdonald
Closing this thread as you have a duplicate open in the Customer Forums. Please do not create two threads for the same issue.