Could not complete SSL handshake (check_nrpe is fine)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by slansing »

Can you remove the '-n' from your check_nrpe command as it has been proven not to work since you had compiled that remote host with ssl support. Otherwise you can duplicate the command and change it's name, then remove the '-n' so you don't mess with other service commands using the original check_nrpe command.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by hazmat »

Thanks, but no difference.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by slansing »

When you do try running check_nrpe from the Core server to the remote system, what errors are you seeing in the remote server's log now?
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by hazmat »

If run from the command line from the Core server, I get:

Apr 9 10:05:03 xinetd[20118]: START: nrpe pid=28471 from=1.2.3.4
Apr 9 10:05:03 nrpe[28471]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Apr 9 10:05:03 xinetd[20118]: EXIT: nrpe status=0 pid=28471 duration=0(sec)

In the remote server's log. I see nothing in the log if run via the application.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by lmiltchev »

You should have something in the remote server's system log... Can you post the log for a review?
You can try reinstalling the openssl package on the remote box and see if this is going to fix the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by abrist »

Code: Select all

check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /var'
It looks like you are declaring the check_disk arg string ( -a ' * ' ) in the service check args, you should eliminate it from the command_line.
Change:

Code: Select all

command_line    /usr/local/nagios/libexec/check_nrpe -n -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$
To:

Code: Select all

command_line    /usr/local/nagios/libexec/check_nrpe -n -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
Andy then restart nagios:

Code: Select all

service nagios restart
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.
mkot
Posts: 68
Joined: Tue Feb 25, 2014 1:47 am
Location: Poland

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by mkot »

Hi, if I remember I had the same issue like you. All I need to do was configure NRPE v2.15 like this:

Code: Select all

 ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/i386-linux-gnu
(you may need to install libssl-dev at your server.) I was using this method at Ubuntu and CentOS servers. And commands for monitoring some stuff:

Monitored host:

Code: Select all

command[check_sw_raid]=/usr/local/nagios/libexec/check_raid
command[check_/]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/md2
command[check_/boot]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/md0
command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -w 98 -c 99
command[check_cpu]=/usr/local/nagios/libexec/check_cpu.sh -w 50 -c 85
Nagios server (for check_sw_raid - sw=software):

Code: Select all

define service{
        use                     local-service
        host_name               domena-pn, localhost
        service_description     SW RAID Status
        check_command           check_nrpe!check_sw_raid
        notifications_enabled   1
        flap_detection_enabled  0
        active_checks_enabled   1
        passive_checks_enabled  0
        }
Oh, I think that Could not complete SSL handshake is also when you use different version of plugins at your host and nagios server.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by sreinhardt »

Thanks Mkot, hopefully that helps them out and we hear back either way!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by abrist »

mkot wrote: Oh, I think that Could not complete SSL handshake is also when you use different version of plugins at your host and nagios server.
As plugins run through nrpe are run from the remote host, using different versions of the plugins between the server and remote host is inconsequential.
mkot wrote:./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/i386-linux-gnu
This is only necessary if the configure script does not detect his openssl lib.
@OP, how is it going?
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.
hazmat
Posts: 39
Joined: Wed Mar 19, 2014 9:17 am

Re: Could not complete SSL handshake (check_nrpe is fine)

Post by hazmat »

Apologies for the delay, and thanks for the continued help. I was away on vacation.

Sorry if this is a stupid question, but how do I tell if the openssl lib has not been detected? I did not build this myself.
Locked