How to migrate Linux clients from Nagios Core to Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

How to migrate Linux clients from Nagios Core to Nagios XI

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post 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
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

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

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Try it without the -n.
Former Nagios Employee.
me.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

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

Post by hkang »

# ./check_nrpe -H ipofremote
CHECK_NRPE: Error - Could not complete SSL handshake.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post 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
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

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

Post 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)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

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

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post 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'
Former Nagios Employee.
me.
Locked