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

Re: NRPE agent not working on Oracle Linux 7

Post by hkang »

The log file is attached. Can you view it?
install.log
You do not have the required permissions to view the files attached to this post.
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 »

Lets make sure your nrpe binary exists:

Code: Select all

ls -l /usr/sbin/nrpe
Is there an appropriate entry in /etc/services?

Code: Select all

grep 5666 /etc/services
The following entry should appear at the end of /etc/services:

Code: Select all

# Nagios services
nrpe    5666/tcp
Please verify that the above entry exists. If it does not, add it and restart xinetd.

A couple of other things to check on:

Code: Select all

systemctl status xinetd -l
Check open ports:

Code: Select all

ss -nap | grep 5666
Try running the binary without xinetd:

Code: Select all

/usr/sbin/nrpe -c /usr/local/nagios/etc/nrpe.cfg --inetd
Check on ports again:

Code: Select all

ss -nap | grep 5666
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 »

The output of those commands:

1. ls -l /usr/sbin/nrpe
ls: cannot access /usr/sbin/nrpe: No such file or directory

2. grep 5666 /etc/services
###UNAUTHORIZED USE: Port 5666 used by SAIC NRPE############
nrpe 5666/tcp

3. systemctl status xinetd -l
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; 1 day 11h 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 options compiled in.
Jan 07 02:00:43 calendar-310-uaex-edu xinetd[1435]: Started working: 1 available service

4. ss -nap | grep 5666
No output

5. /usr/sbin/nrpe -c /usr/local/nagios/etc/nrpe.cfg --inetd
-bash: /usr/sbin/nrpe: No such file or directory
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: NRPE agent not working on Oracle Linux 7

Post by hkang »

It seems that the nrpe binary doesn't exist. How can I add it?
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 »

Does the binary exist anywhere?

Code: Select all

find / -name nrpe -type f
It should exist somewhere - either in the directory where you installed nrpe from (typically /tmp) or somewhere else on the system. Be sure that xinetd knows exactly what to point to.

If the NRPE binary is in /tmp, be sure to copy it to somewhere sane (/usr/local/nagios/bin/ for instance).

Jesse
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 »

There are two nrpe files on this server. But I don't think either of them is what we are looking for, since they are not binary files.

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 = /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
}

2. cat /tmp/nagjos/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/package/solaris/pkg/nrpe
#!/sbin/sh
#

NRPE=/opt/nagios/bin/nrpe
CFGFILE=/etc/nagios/nrpe.cfg
PIDFILE=/var/run/nrpe.pid

case $1 in
'start')
$NRPE -c $CFGFILE -d
;;

'restart')
if [ -f "$PIDFILE" ]; then
/usr/bin/kill -HUP `/usr/bin/cat $PIDFILE`
fi
;;

'stop')
if [ -f "$PIDFILE" ]; then
/usr/bin/kill `/usr/bin/cat $PIDFILE`
/bin/rm -f $PIDFILE
fi
;;

*)
echo "Usage: $0 { start | restart | stop }"
exit 1
;;
esac

exit $?
hkang
Posts: 41
Joined: Tue Jan 05, 2016 4:34 pm

Re: NRPE agent not working on Oracle Linux 7

Post by hkang »

I found a nrpe binary file on another box which is running CentOS 6.7 and has nrpe agent working fine on it. Can I copy that file to this OL 7 box?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NRPE agent not working on Oracle Linux 7

Post by rkennedy »

Taking a step back, I reviewed your install.log. It appears you're missing libmcrypt

Can you run the following command, and post the output?

Code: Select all

rpm -qa|grep libmcrypt
Regarding copying the file - this may work at times, but usually not. As the binaries are compiled based off of your environment you could run into weird issues.
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 »

No output for "rpm -qa|grep libmcrypt".
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 »

You'll likely have to install the libmcrypt and libmcrypt-devel libraries, give the following a try.

Code: Select all

yum install libmcrypt libmcrypt-devel
Let us know if there are any problems with the above. After you've installed the libraries, attempt installing NRPE again and see if the binary generates appropriately this time.

Jesse
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.
Locked