Page 1 of 3

migrating nagios to new server causing CHECK_NRPE: Error

Posted: Tue Aug 11, 2015 3:02 pm
by sinkak
i migrated nagios from old server to new one.
i copied same config files from old one to new server. just changed paths alone on config files.
UI is working. getting regular updates.

but for some hosts they have CHECK_NRPE: Error - Could not complete SSL handshake.

i checked on old server

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H client1ip
NRPE v2.12
on new server

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H client1ip
CHECK_NRPE: Error - Could not complete SSL handshake
there are so many clients which have same error.
i suppose old admin might not have edited each clients allowed hosts parameter in nrpe.cfg file.
there must be some other way.

do i have to edit each client nrpe.cfg file?

Please help.

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Tue Aug 11, 2015 3:10 pm
by jdalrymple
sinkak wrote:i suppose old admin might not have edited each clients allowed hosts parameter in nrpe.cfg file.
there must be some other way.

do i have to edit each client nrpe.cfg file?
This might be a good opportunity to roll out some devops?

an every 5 minute cron job that wgets a nrpe.cfg is a great thing.

So - "yes" is the answer to your question, unless assuming the old IP is a possibility. Also note before you go deep into the woods that it may not be nrpe.cfg, it could be inetd.conf.

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Thu Aug 13, 2015 10:56 am
by sinkak
old server has nrpe.cfg files in

Code: Select all

ubuntu@monitoring:/etc/nagios3$ sudo find / -name nrpe.cfg
/home/WSA/alexander.lavrenko/devops/storage/etc/nagios/nrpe.cfg
/home/WSA/alexander.lavrenko/devops_/storage/etc/nagios/nrpe.cfg
/home/WSA/alexander.lavrenko/devops__/storage/etc/nagios/nrpe.cfg
/home/WSA/alexey.tkachev/devops_old/storage/etc/nagios/nrpe.cfg
/home/WSA/alexey.tkachev/devops/storage/etc/nagios/nrpe.cfg
/home/WSA/andrey.sviridov/devops/storage/etc/nagios/nrpe.cfg
/home/WSA/dmitriy.dranenko/devops/storage/etc/nagios/nrpe.cfg
/home/ubuntu/nagios/nrpe.cfg
/root/devops/storage/etc/nagios/nrpe.cfg
new server has in

Code: Select all

ubuntu@newnagios:~$ sudo find / -name nrpe.cfg

/home/ubuntu/nagios/nrpe.cfg
/etc/nagios/nrpe.cfg
how do we find out where clients are getting nrpe.cfg file from old server?

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Thu Aug 13, 2015 12:02 pm
by jdalrymple

Code: Select all

[jdalrymple@localhost etc]$ ps -ef | grep nrpe
500       50521  40945  0 03:55 pts/0    00:00:00 grep nrpe
If like in my info you get no useful output, try this instead:

Code: Select all

[jdalrymple@localhost etc]$ grep nrpe /etc/xinetd.d/nrpe
service nrpe
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Thu Aug 13, 2015 1:14 pm
by sinkak

Code: Select all

ubuntu@ip:~$ grep nrpe /etc/xinetd.d/nrpe
service nrpe
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd


/usr/local/nagios/etc/nrpe.cfg <----- is this the path where client getting nrpe.cfg file ?

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Thu Aug 13, 2015 1:34 pm
by tgriep
Yes, that is where the daemon gets the configuration settings for the NRPE daemon.
If you are running NRPE under xinetd, then you would have to edit this file below to add the IP address of the new server using the only_from option.

Code: Select all

/etc/xinetd.d/nrpe
They are a space delimited list of IP address that can connect to the NRPE daemon.

Any chance you can shut down the old server, change the IP address of the new system to the old to fix this?

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Thu Aug 13, 2015 1:40 pm
by sinkak
i cant reassign old server ip to new.

but i made all the changes in xinet.d and i am waiting on clients to read it.

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Thu Aug 13, 2015 3:00 pm
by tgriep
That's too bad, let us know if you need any more help.

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Mon Aug 17, 2015 10:09 am
by sinkak
Even after making changes to inetd.

Code: Select all

ubuntu@ip:~$ grep nrpe /etc/xinetd.d/nrpe
service nrpe
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
still has same error.
CHECK_NRPE: Error - Could not complete SSL handshake.


i tried adding new server ip to one of the clients nrpe.cfg file. That removed the error.i have more than 100 hosts. i cant edit on each client.
Is there any thing i can do like that on server side so that it changes all clients config file?

Re: migrating nagios to new server causing CHECK_NRPE: Error

Posted: Mon Aug 17, 2015 12:05 pm
by sinkak
i added no ssl option to check_nrpe on server side

Code: Select all

define command{
        command_name   check_nrpe
        command_line       /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 40 -c $ARG1$ -n
}
this removed SSL error