Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
1 November 2012

Installing Nagios Remote Plugin Executor in CentOS and Ubuntu

by Alpha01


yum install openssl openssl-devel gcc make autoconf xinetd


apt-get install openssl build-essential libssl-dev gcc make autoconf xinetd

Create nagios user and give it a password.

/usr/sbin/useradd -m nagios
passwd nagios

Download and extract the latest stable Nagios Plugins from Configure, compile and install the Nagios plugins.

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make install

Download the latest NRPE plugin from–2D-Nagios-Remote-Plugin-Executor/details. Extract, configure, compile and install the plugin with xinetd configuration.

make all
make install-daemon
make install-xinetd

Edit the /etc/xinetd.d/nrpe file and add the IP address of the monitoring server to the only_from directive.

only_from = <nagios_ip_address>

Add the following entry for the NRPE daemon to the /etc/services file.

nrpe 5666/tcp # NRPE

Restart the xinetd service.

/etc/init.d/xinetd restart

Copy over sample config file.

mkdir /usr/local/nagios/etc/
cp sample-config/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg

Copy over check_nrpe binary to /usr/local/nagios/libexec

cp src/check_nrpe /usr/local/nagios/libexec/

Update permissions.

chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec

Update firewall.

iptables -A INPUT -p tcp -m tcp --dport 5666 -j ACCEPT

Testing Communication

Issue the following command to test communication on the Nagios monitoring server. Replace IP “”, with the NRPE client’s IP.

/usr/local/nagios/libexec/check_nrpe -H

You should get a string back that tells you what version of NRPE is installed on the remote host, like this:

NRPE v2.13
Tags: [ nagios centos ubuntu ]