Page 3 of 5
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 1:22 pm
by hkang
The log file is attached. Can you view it?
install.log
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 2:29 pm
by jolson
Lets make sure your nrpe binary exists:
Is there an appropriate entry in /etc/services?
The following entry should appear at the end of /etc/services:
Please verify that the above entry exists. If it does not, add it and restart xinetd.
A couple of other things to check on:
Check open ports:
Try running the binary without xinetd:
Code: Select all
/usr/sbin/nrpe -c /usr/local/nagios/etc/nrpe.cfg --inetd
Check on ports again:
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 2:43 pm
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
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 2:55 pm
by hkang
It seems that the nrpe binary doesn't exist. How can I add it?
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 2:59 pm
by jolson
Does the binary exist anywhere?
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
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 3:19 pm
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 $?
Re: NRPE agent not working on Oracle Linux 7
Posted: Fri Jan 08, 2016 3:24 pm
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?
Re: NRPE agent not working on Oracle Linux 7
Posted: Mon Jan 11, 2016 3:01 pm
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?
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.
Re: NRPE agent not working on Oracle Linux 7
Posted: Mon Jan 11, 2016 3:42 pm
by hkang
No output for "rpm -qa|grep libmcrypt".
Re: NRPE agent not working on Oracle Linux 7
Posted: Mon Jan 11, 2016 4:57 pm
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