Page 1 of 2

CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Tue Feb 23, 2016 2:24 pm
by villex46
Hello,

I'm trying to install nagios agent in a centos server but I get it.
I'm following this link: http://www.tecmint.com/how-to-add-linux ... ng-server/

shows these errors:

Code: Select all

[root@localhost nagios]# /usr/local/nagios/libexec/check_nrpe -H localhost
CHECK_NRPE: Error - Could not complete SSL handshake.

Code: Select all

[root@localhost nagios]# /usr/local/nagios/libexec/check_nrpe -H <IP_Nagios_Server> -n
connect to address  <IP_Nagios_Server> port 5666: No route to host
connect to host  <IP_Nagios_Server> port 5666: No route to host
[root@localhost nagios]#

I tried to follow several fix it but I have not gotten anything:
- all solutions of this doc https://assets.nagios.com/downloads/nag ... utions.pdf
- disable firewall


Several output commads:

Code: Select all

[root@localhost nagios]# netstat -na | grep 5666
tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN
tcp6       0      0 :::5666                 :::*                    LISTEN

Code: Select all


[root@localhost nagios]# nmap <IP_Nagios_Server> -p 5666

Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-23 20:22 CET
Nmap scan report for <Name_Nagios_Server> (<IP_Nagios_Server>)
Host is up (0.00083s latency).
PORT     STATE    SERVICE
5666/tcp filtered nrpe

Nmap done: 1 IP address (1 host up) scanned in 5.58 seconds
any ideas?

thanks!

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Tue Feb 23, 2016 2:27 pm
by hsmith
Can we see the contents of these files?

Code: Select all

/etc/xinetd.d/nrpe
/usr/local/nagios/etc/nrpe.cfg

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Tue Feb 23, 2016 2:37 pm
by villex46
thanks for reply!

Code: Select all

[root@localhost nagios]# grep only_from /etc/xinetd.d/nrpe
only_from       = 127.0.0.1 localhost 123.123.123.123

[root@localhost nagios]# grep allowed_hosts /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,123.123.123.123 
Note: 123.123.123.123 = IP_Nagios_Server

Do you need all output?

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Tue Feb 23, 2016 2:42 pm
by eloyd
This is probably the most asked question on all of the Nagios support forums. I strongly suggest a sticky topic here that points to https://support.nagios.com/kb/category.php?id=10 and a really prominent article there that describes the common install/config problems.

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Tue Feb 23, 2016 2:55 pm
by rkennedy
Does /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 work?

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Wed Feb 24, 2016 11:00 am
by villex46
thanks again.

Don't Work

Code: Select all

[root@localhost ~]#  /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
CHECK_NRPE: Error - Could not complete SSL handshake.

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Wed Feb 24, 2016 3:33 pm
by jolson
Check the libraries of the NRPE daemon and the life of your nagios user:

Code: Select all

grep nagios /etc/passwd
ldd /usr/local/nagios/bin/nrpe
chage -l nagios
Please post the results here. In addition to the above, try the following:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -n

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Wed Feb 24, 2016 3:50 pm
by villex46
[root@localhost ~]# grep nagios /etc/passwd
nagios:x:1001:1001::/home/nagios:/bin/bash
[root@localhost ~]# ldd /usr/local/nagios/bin/nrpe
linux-vdso.so.1 => (0x00007ffdeb7fe000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007f569d481000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f569d09a000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f569ce80000)
libc.so.6 => /lib64/libc.so.6 (0x00007f569cabf000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f569c873000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f569c58d000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f569c389000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f569c157000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f569bf52000)
libz.so.1 => /lib64/libz.so.1 (0x00007f569bd3c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f569d6f7000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f569bb2d000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f569b928000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f569b70e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f569b4f2000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f569b2cc000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f569b06b000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f569ae46000)
[root@localhost ~]# chage -l nagios
Último cambio de contraseña :feb 15, 2016
La contraseña caduca : nunca
Contraseña inactiva : nunca
La cuenta caduca : nunca
Número de días mínimo entre cambio de contraseña : 0
Número de días máximo entre cambio de contraseña : 99999
Número de días de aviso antes de que caduque la contraseña : 7
[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -n
CHECK_NRPE: Error receiving data from daemon.
[root@localhost ~]#

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Wed Feb 24, 2016 3:57 pm
by jolson
All of that looks fine.

Code: Select all

5666/tcp filtered nrpe
Typically this means that the firewall is not completely open. Check on your firewall status with one of the following:

Code: Select all

iptables -L -n | grep 5666
firewall-cmd --list-all | egrep "5666|nrpe"
I'm also interested in the running processes:

Code: Select all

ps -ef | egrep "nrpe|xinetd"
Lastly, I'd like to see your whole nrpe.cfg file:

Code: Select all

cat /usr/local/nagios/etc/nrpe.cfg

Re: CHECK_NRPE: Error - Could not complete SSL handshake

Posted: Wed Feb 24, 2016 4:34 pm
by villex46
thanks you!!! thanks you!!!thanks you!!!thanks you!!!

this problem it's solved!
now show other error

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -n
CHECK_NRPE: Error receiving data from daemon.
I will now investigate the problem