Page 1 of 3

How to migrate Linux clients from Nagios Core to Nagios XI

Posted: Wed Jan 13, 2016 11:47 am
by hkang
Hello,

Since we are currently using Nagios Core, I installed NRPE plugin on all of our Linux servers. It worked fine with Core monitoring host. But it doesn't work with XI monitoring host. I modified the nrpe config file (/usr/local/nagios/etc/nrpe.cfg) and changed the allowed_hosts to the current Xl server IP, but still got the status of "CHECK_NRPE: Error - Could not complete SSL handshake." from monitoring host. How to fix it?

Thank you for your help!

Hong Kang

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Wed Jan 13, 2016 3:31 pm
by jolson
Hong Kang,

Do you have NRPE running on your remote machines under xinetd? A good indicator that xinetd is in use is if the following file exists:

Code: Select all

cat /etc/xinetd.d/nrpe
If the above file exists, you will need to add your Nagios XI IP address there instead of in the nrpe.cfg file. You might also try running check_nrpe from Nagios XI using the -n flag to disable SSL:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H <hostname> -n

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Wed Jan 13, 2016 4:16 pm
by hkang
1. cat /etc/xinetd.d/nrpe
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1 ipofxi
}

2. ./check_nrpe -H ipofremote -n
CHECK_NRPE: Error receiving data from daemon.

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Wed Jan 13, 2016 4:17 pm
by hsmith
Try it without the -n.

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Wed Jan 13, 2016 4:24 pm
by hkang
# ./check_nrpe -H ipofremote
CHECK_NRPE: Error - Could not complete SSL handshake.

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Wed Jan 13, 2016 4:57 pm
by jolson
ipofxi
Are you certain that XI isn't going through NAT or similar? Is there a difference in NRPE version between the two installs of Nagios? Typically this should work with no problems.

On your remote host, please run an 'ldd' against your NRPE binary.

Code: Select all

ldd /usr/local/nagios/bin/nrpe

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Wed Jan 13, 2016 5:14 pm
by hkang
On this box, I installed NRPE plugin (nagios-plugins-2.0.2.tar.gz) which worked fine with Nagios Core monitoring host. After we decided to try Nagios XI, I installed NRPE agent (linux-nrpe-agent.tar.gz) on another box which works with Nagios XI host. I know these are two different files, and the installation steps are also different.

Here is the output for ldd:
# ldd /usr/local/nagios/bin/nrpe
linux-vdso.so.1 => (0x00007fff745f2000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00000030a9400000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00000030a6800000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00000030b2a00000)
libc.so.6 => /lib64/libc.so.6 (0x000000309f800000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00000030a9000000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00000030a8800000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00000030a7400000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00000030a7c00000)
libdl.so.2 => /lib64/libdl.so.2 (0x00000030a0000000)
libz.so.1 => /lib64/libz.so.1 (0x000000309f400000)
/lib64/ld-linux-x86-64.so.2 (0x000000309f000000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00000030a8400000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00000030a8000000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00000030a1400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000309fc00000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00000030a1000000)

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Thu Jan 14, 2016 12:38 am
by Box293
jolson wrote:Hong Kang,

Do you have NRPE running on your remote machines under xinetd? A good indicator that xinetd is in use is if the following file exists:

Code: Select all

cat /etc/xinetd.d/nrpe
If the above file exists, you will need to add your Nagios XI IP address there instead of in the nrpe.cfg file. You might also try running check_nrpe from Nagios XI using the -n flag to disable SSL:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H <hostname> -n
hkang wrote:1. cat /etc/xinetd.d/nrpe
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1 ipofxi
}

2. ./check_nrpe -H ipofremote -n
CHECK_NRPE: Error receiving data from daemon.
After making these changes, did you restart the xinetd service on the remote host?

Code: Select all

service xinetd restart
We also have this guide as it address issues similar to yours:

https://assets.nagios.com/downloads/nag ... utions.pdf

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Thu Jan 14, 2016 10:06 am
by hkang
After I restarted the xinetd service on the remote client, I got the following from the monitoring website:

/ Disk Usage Unknown 13m 4s 5/5 2016-01-14 09:01:11 CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

/home Disk Usage Unknown 12m 48s 5/5 2016-01-14 09:01:27 CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

/tmp Disk Usage Unknown 11m 48s 5/5 2016-01-14 09:02:27 CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

CPU Stats Unknown 11m 34s 5/5 2016-01-14 09:02:42 CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

Re: How to migrate Linux clients from Nagios Core to Nagios

Posted: Thu Jan 14, 2016 11:27 am
by hsmith
Can I please see the output of this command from the box you are trying to get NRPE working on?

Code: Select all

cat /usr/local/nagios/etc/nrpe.cfg | sed -e '/^\s*$/d' -e '/^#/d'