NRPE agent not working on Oracle Linux 7
Re: NRPE agent not working on Oracle Linux 7
The log file is attached. Can you view it?
You do not have the required permissions to view the files attached to this post.
Re: NRPE agent not working on Oracle Linux 7
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:
Check on ports again:
Code: Select all
ls -l /usr/sbin/nrpeCode: Select all
grep 5666 /etc/servicesCode: Select all
# Nagios services
nrpe 5666/tcpA couple of other things to check on:
Code: Select all
systemctl status xinetd -lCode: Select all
ss -nap | grep 5666Code: Select all
/usr/sbin/nrpe -c /usr/local/nagios/etc/nrpe.cfg --inetdCode: Select all
ss -nap | grep 5666Re: NRPE agent not working on Oracle Linux 7
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
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
It seems that the nrpe binary doesn't exist. How can I add it?
Re: NRPE agent not working on Oracle Linux 7
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
Code: Select all
find / -name nrpe -type fIf 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
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 $?
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
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
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.
Can you run the following command, and post the output?
Code: Select all
rpm -qa|grep libmcrypt
Former Nagios Employee
Re: NRPE agent not working on Oracle Linux 7
No output for "rpm -qa|grep libmcrypt".
Re: NRPE agent not working on Oracle Linux 7
You'll likely have to install the libmcrypt and libmcrypt-devel libraries, give the following a try.
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
Code: Select all
yum install libmcrypt libmcrypt-develJesse