It’s really simple to configure NRPE to run under xinetd in Linux. Here’s how to install it.
1. First install nrpe using yum. Your default Redhat/CentOS distro should come with xinetd pre-installed and running. If not, install xinetd as well.
yum install nrpe
2. under /etc/xinetd.d/ create a file called ‘nrpe’ and copy and past the below contents:
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
type = UNLISTED
port = 5666
socket_type = stream
wait = no
user = nagios
group = nagios
server = /usr/sbin/nrpe
server_args = -c /etc/nagios/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
# only_from = 10.1.0.181
}
You can un-comment the ‘only_from’ option if you want to restrict IP access to the client.
3. Restart the xinetd service
service xinetd restart
4. Check if the service is running and listening on 5666
[root@linux ~]# netstat -nap |grep 5666 tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 8761/xinetd
5. Make sure your firewall allows tcp port 5666!
6. Configure your nagios server to check this host!
Note. Make sure you have the right plugins installed on the client and nagios server if you have any special checks. You can install them using yum.
Sample configuration on the server
Here’s a sample servce check that I implemented on the server which checks the load.
define service{
use system-resource
host_name Linux
service_description LOAD
check_command check_nrpe!check_load
}
For more information please visit http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf