CHECK_NRPE: Error receiving data from daemon

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
cshaffer
Posts: 38
Joined: Tue May 13, 2014 10:45 am

CHECK_NRPE: Error receiving data from daemon

Post by cshaffer »

I am setting up a RHEL4 server as a client. check_nrpe runs OK from the server and the client.
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
From the client, the check_disk command works OK
check_disk -w 20% -c 10% -p / returns DISK OK etc.
But when I try running the check_disk from the client as a command of check_nrpe an error occurs.
check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /' -n returns CHECK_NRPE: Error receiving data from daemon.
When I check the system log /var/log/messages I see Error: Could not complete SSL handshake. 1
I thought that the -n option in the check_nrpe command told it not to use SSL?

The command definition in /usr/local/nagios/etc/nrpe/common.cfg is command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
The service nrpe definition in /etc/xinetd.d/nrpe contains the line only_from = 127.0.0.1 10.206.201.19 (localhost and nagios server)
In the file /usr/local/nagios/etc/nrpe.cfg
allowed_from=127.0.0.1,10.206.201.19 (localhost and server)
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

Any help would be appreciated.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CHECK_NRPE: Error receiving data from daemon

Post by tmcdonald »

Do you have dont_blame_nrpe set to 1 in the NRPE config?

EDIT: Link to previous thread: http://support.nagios.com/forum/viewtop ... =6&t=27051
Former Nagios employee
cshaffer
Posts: 38
Joined: Tue May 13, 2014 10:45 am

Re: CHECK_NRPE: Error receiving data from daemon

Post by cshaffer »

Yes. That was the default and I left it alone. By the way, I saw two other users with a similar question on the general discussion list.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CHECK_NRPE: Error receiving data from daemon

Post by lmiltchev »

Instead of this:

Code: Select all

./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /' -n
you should be running this:

Code: Select all

./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /'
If for some reason, you complied nrpe with no ssl, you could try this instead:

Code: Select all

./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p / -n'
Be sure to check out our Knowledgebase for helpful articles and solutions!
cshaffer
Posts: 38
Joined: Tue May 13, 2014 10:45 am

Re: CHECK_NRPE: Error receiving data from daemon

Post by cshaffer »

When I tried ./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /'
I got a different error message. CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
I hadn't seen this error message before.
But the system log still had the Error: Could not complete SSL handshake. 1, the same as the other error messages. This seems to be the root problem.
When I tried using the -n option with the check_disk command, ./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p / -n'
I got the Received 0 bytes error again. Could not complete SSL handshake. 1

I think SSL is compiled into nagios. But it is certainly possible that something went wrong when I installed it. Can I reinstall it over the old installation?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CHECK_NRPE: Error receiving data from daemon

Post by lmiltchev »

Have you restarted xinetd after making changes in the nrpe file? Try:

Code: Select all

service xinetd restart
./check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /'
Be sure to check out our Knowledgebase for helpful articles and solutions!
cshaffer
Posts: 38
Joined: Tue May 13, 2014 10:45 am

Re: CHECK_NRPE: Error receiving data from daemon

Post by cshaffer »

Thanks. I have been restarting xinetd, but to make sure, I did it again and tried the command again. This time the error was Received 0 bytes from daemon. Check the remote server logs for more error messages.

Checked the /var/log/messages file and it was the Error: Could not complete SSL handshake. 1 again.

Since the check_nrpe and the check_disk commands run OK when run standalone, the problem must be with the check_disk command being processed through the check_nrpe command. Is it possible that it is a bug? I am totally guessing here.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CHECK_NRPE: Error receiving data from daemon

Post by lmiltchev »

Is NRPE running as a standalone daemon? I thought, you were running it under xinetd... What is the output of the following two commands (run on the remote box)?

Code: Select all

ps axuw | grep nrpe
netstat -at | grep nrpe
Be sure to check out our Knowledgebase for helpful articles and solutions!
cshaffer
Posts: 38
Joined: Tue May 13, 2014 10:45 am

Re: CHECK_NRPE: Error receiving data from daemon

Post by cshaffer »

Here is the output from the commands

-bash-3.00# ps axuw | grep nrpe
root 21555 0.0 0.0 5224 644 pts/5 S+ 14:24 0:00 grep nrpe

-bash-3.00# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN

When I set this up on the client, I used an archive called. linux-nrpe-agent-el4.tar.gz. This created a directory called linux-nrpe-agent-el4. In that directory there is a script called fullinstall. It told me that the install had successfully completed. I notice that there is some code in fullinstall that checks to make sure that the redhat version is 5 or above, but it is commented out. Is RedHat EL4 supported as a Nagios client host? The el4 in the tarball's name leads me to think it is. Maybe I should run the install again? Or is there a better way to do the install?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: CHECK_NRPE: Error receiving data from daemon

Post by abrist »

cshaffer wrote:-bash-3.00# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
Looks like nrpe is running.
cshaffer wrote:The el4 in the tarball's name leads me to think it is.
Yeah, this is that last of the el4 packages.

Lets test nrpe from the nagios XI server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <ip of remote host>
You should see version output.
Now lets alter the nrpe.cfg on the remote host, from:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
To:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Restart nrpe on the remote system.
Looking at your first post, try running the check withouut ssl as the version can be pulled without it:

Code: Select all

check_nrpe -H localhost -c check_disk -a '-w 20% -c 10% -p /' 
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked