NRPE agent not working on Oracle Linux 7

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

NRPE agent not working on Oracle Linux 7

Post by hkang »

Hello,

We are now planning to switch from Nagios Core to Nagios Xl to monitor both Linux and Windows servers. But I have some questions about Nagios Xl on Linux.

1. I installed NRPE agent on one of Oracle Linux 7 servers. But the monitoring host seems not able to communication with it. The status shows "Return code of 255 is out of bounds".

2. Since we are currently using Nagios Core, I installed NRPE plugin on all of our Linux servers. But it doesn't work with Nagios Xl. Do I have to remove NRPE plugin and install NRPE agent? How can I remove the plugin? I couldn't find any documentation for that.

Thank you for your help!

Hong Kang
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: NRPE agent not working on Oracle Linux 7

Post by hsmith »

hkang wrote:I installed NRPE agent on one of Oracle Linux 7 servers. But the monitoring host seems not able to communication with it. The status shows "Return code of 255 is out of bounds".
How did you install the agent? Can you show the output of it failing from the command line? (Output from the XI server, check failing to the remote server)
hkang wrote:Since we are currently using Nagios Core, I installed NRPE plugin on all of our Linux servers. But it doesn't work with Nagios Xl. Do I have to remove NRPE plugin and install NRPE agent? How can I remove the plugin? I couldn't find any documentation for that.
What do you mean it doesn't work with Nagios XI? NRPE won't need to be reinstalled on the remote servers. You will likely need to update the configuration to allow the IP of the XI server to communicate with the NRPE agent.
Former Nagios Employee.
me.
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: NRPE agent not working on Oracle Linux 7

Post by hkang »

1. My first attempt of the installation failed. I got the error "can't read /etc/xinetd.d/nrpe: No such file or directory". Then I created the nrpe file manually. Finally, install complete successfully. But I got the status of "Return code of 255 is out of bounds" from monitoring host. Here is the nrpe file:

# 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/sbin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 10.200.160.93
}

2. 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE agent not working on Oracle Linux 7

Post by rkennedy »

From the command line of the Nagios server, can you try running /usr/local/nagios/libexec/check_nrpe -H ipofmachine -n and post the result? (change ipofmachine to the client machine running NRPE)
Former Nagios Employee
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: NRPE agent not working on Oracle Linux 7

Post by hkang »

1. connect to address ipofmachine port 5666: No route to host

2. CHECK_NRPE: Error receiving data from daemon.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: NRPE agent not working on Oracle Linux 7

Post by jolson »

To me it seems like there are two problems at play here.

First, you have one (or many) Oracle Linux 7 boxes that appear to not work with NRPE. Is that statement correct?

Second, you are migrating from Nagios Core to Nagios XI, implying that you had NRPE working in the past. I assume that you never had NRPE working on your Oracle Linux 7 boxes?

I think it would be best to focus on one of the above problems at a time so that we don't get our wires crossed.
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: NRPE agent not working on Oracle Linux 7

Post by hkang »

You are right. These are two different issues on two different Linux servers.

The first message was from Oracle Linux 7 box, and this is the first time I try NRPE on OL 7.

The second message was from another Oracle Linux 6.7 box, and I am moving from Core to XI on this one. I installed NRPE plugin (nrpe-2.15.tar.gz) before, and it worked fine with Core monitoring host. But it doesn't work with XI monitoring host.

We can definitely work on only one problem at a time. How about the first one?

Thank you!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: NRPE agent not working on Oracle Linux 7

Post by jolson »

The first one sounds good to me. :)

First of all, it looks like you used the fullinstall script on your Oracle Linux box and the script completed successfully. Is that correct?

I'd like you to check on the following for me please -
Is xinetd running?

Code: Select all

service xinetd status
Is 10.200.160.93 the correct IP of your Nagios Server? Please verify that Nagios isn't going through any sort of NAT to get to the remote server.

Please add 127.0.0.1 to the xinetd config file, like so:

Code: Select all

{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/sbin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 10.200.160.93 127.0.0.1
}
After adding localhost, attempt to run the following _from your Oracle Linux 7 box_.

Code: Select all

cd /usr/loca/nagios/libexec
./check_nrpe -H 127.0.0.1
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: NRPE agent not working on Oracle Linux 7

Post by hkang »

1. Yes. xinetd is running. Here is the output:

Redirecting to /bin/systemctl status xinetd.service
xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled)
Active: active (running) since Thu 2016-01-07 02:00:43 CST; 10h ago
Process: 1424 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 1435 (xinetd)
CGroup: /system.slice/xinetd.service
└─1435 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing discard
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing discard
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing echo
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing echo
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing tcpmux
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing time
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: removing time
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: Must specify a server in nrpe
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking...d in.
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: Started working: 1 available service
Hint: Some lines were ellipsized, use -l to show in full.

2. IP address of Nagios server is correct. The xinetd config file is modified.

3. The output of ./check_nrpe -H 127.0.0.1:

-bash: ./check_nrpe: No such file or directory
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: NRPE agent not working on Oracle Linux 7

Post by hsmith »

hkang wrote:3. The output of ./check_nrpe -H 127.0.0.1:
It looks like there was a typo in this part of the command:

Code: Select all

cd /usr/loca/nagios/libexec
Try this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Former Nagios Employee.
me.
Locked