RHEL 6.3 & NRPE Issues

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.
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: RHEL 6.3 & NRPE Issues

Post by 00_kl250 »

[root@TDMAURCMESERV32 ~]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -i
[root@TDMAURCMESERV32 ~]#


[nagios@TDMAURCMESERV32:/root] /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -i
^C
[nagios@TDMAURCMESERV32:/root]


It just sat there and hung as nagios.

output of /var/log/messages


Sep 24 11:07:09 localhost xinetd[28656]: Exiting...
Sep 24 11:07:09 localhost xinetd[31763]: Address: 127.0.0.1, has a comma in it - remove the comma [file=/etc/xinetd.d/nrpe] [line=15]
Sep 24 11:07:09 localhost xinetd[31763]: Error parsing attribute only_from - DISABLING SERVICE [file=/etc/xinetd.d/nrpe] [line=15]
Sep 24 11:07:09 localhost xinetd[31763]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Sep 24 11:07:09 localhost xinetd[31763]: Started working: 0 available services
Sep 24 12:03:49 localhost nrpe[41915]: Error: NRPE daemon cannot be run as user/group root!
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: RHEL 6.3 & NRPE Issues

Post by eloyd »

Thanks. This confirms what the expected behavior would be, which means that I am now officially out of ideas as to why your NRPE daemon is not listening.

So here is my last ditch effort. Let's try running nrpe outside of xinetd. Type these as root:

Code: Select all

service xinetd stop
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
lsof -i:5666
nmap -P0 -p 5666 localhost
I REALLY hope that it shows something listening. Most likely, your nrpe.cfg file is not set up to allow connections from your Nagios host, so your NRPE checks will fail, but at least let's see if we can't get it going.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: RHEL 6.3 & NRPE Issues

Post by 00_kl250 »

[root@TDMAURCMESERV32 ~]# service xinetd stop
Stopping xinetd: [ OK ]
[root@TDMAURCMESERV32 ~]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
[root@TDMAURCMESERV32 ~]# lsof -i:5666
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nrpe 1013 nagios 4u IPv4 12423033 0t0 TCP *:nrpe (LISTEN)
nrpe 1013 nagios 5u IPv6 12423034 0t0 TCP *:nrpe (LISTEN)
[root@TDMAURCMESERV32 ~]# nmap -P0 -p 5666 localhost

Starting Nmap 5.51 ( http://nmap.org ) at 2014-09-24 12:47 CDT
Failed to find device bond0 which was referenced in /proc/net/route
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000028s latency).
Other addresses for localhost (not scanned): 127.0.0.1
PORT STATE SERVICE
5666/tcp open nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
[root@TDMAURCMESERV32 ~]#
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: RHEL 6.3 & NRPE Issues

Post by eloyd »

So it works as a daemon, but not from xinetd.
So now you need to kill 1013 to kill the NRPE daemon you ran and figure out why xinetd is not running it properly.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: RHEL 6.3 & NRPE Issues

Post by 00_kl250 »

Ok. I'll do some research on why xinetd is not running nrpe. Thanks for all your help!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: RHEL 6.3 & NRPE Issues

Post by lmiltchev »

Ok. I'll do some research on why xinetd is not running nrpe. Thanks for all your help!
Sounds good! Let us know if you need any more help.
Be sure to check out our Knowledgebase for helpful articles and solutions!
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: RHEL 6.3 & NRPE Issues

Post by 00_kl250 »

Ok.

So I upgraded my xinetd to the latest version.

when i run netstat -at | grep nrpe things appear to be working:

[root@TDMAURCMESERV32 default]# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
tcp 0 0 *:nrpe *:* LISTEN


However, when I run /usr/local/nagios/libexec/check_nrpe -H localhost I now get the following error:

[root@TDMAURCMESERV32 default]# /usr/local/nagios/libexec/check_nrpe -H localhost
CHECK_NRPE: Error - Could not complete SSL handshake.


If i try to run using the -n parameter, to not run with ssl, i get the following error:

[root@TDMAURCMESERV32 default]# /usr/local/nagios/libexec/check_nrpe -n -H localhost
CHECK_NRPE: Error receiving data from daemon.

After i resart the xinetd service, i get the following in the /var/log/messages file:

Sep 29 09:39:40 localhost xinetd[1666]: Exiting...
Sep 29 09:39:40 localhost xinetd[3300]: bind failed (Address already in use (errno = 98)). service = nrpe
Sep 29 09:39:40 localhost xinetd[3300]: Service nrpe failed to start and is deactivated.
Sep 29 09:39:40 localhost xinetd[3300]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Sep 29 09:39:40 localhost xinetd[3300]: Started working: 0 available services
Sep 29 09:40:09 localhost nrpe[3414]: Host ::1 is not allowed to talk to us!
Sep 29 09:42:13 localhost nrpe[3825]: Host ::1 is not allowed to talk to us!


Any ideas?
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: RHEL 6.3 & NRPE Issues

Post by eloyd »

Code: Select all

cat /etc/xinetd.d/nrpe
I'll bet the "only_from" line doesn't have the proper IP addresses to allow you to connect.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: RHEL 6.3 & NRPE Issues

Post by 00_kl250 »

My monitoring server is 192.168.0.29

[root@TDMAURCMESERV32 default]# 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 192.168.0.29
}


I've tried taking out 127.0.0.1 and I've also put in 127.0.0.1,192.168.0.29 (with and without a space after the comma) and no luck
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: RHEL 6.3 & NRPE Issues

Post by 00_kl250 »

I tried with just the local address:

[root@TDMAURCMESERV32 default]# 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
}

[root@TDMAURCMESERV32 default]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@TDMAURCMESERV32 default]# /usr/local/nagios/libexec/check_nrpe -H localhost
CHECK_NRPE: Error - Could not complete SSL handshake.
Locked