The purpose of this addon is to allow you to execute Nagios
plugins on a remote host in as transparent a manner as possible.
There are two pieces to this addon:
1) NRPE - This program runs as a background process on the
remote host and processes command execution requests
from the check_nrpe plugin on the Nagios host.
Upon receiving a plugin request from an authorized
host, it will execute the command line associated
with the command name it received and send the
program output and return code back to the
2) check_nrpe - This is a plugin that is run on the Nagios host
and is used to contact the NRPE process on remote
hosts. The plugin requests that a plugin be
executed on the remote host and wait for the NRPE
process to execute the plugin and return the result.
The plugin then uses the output and return code
from the plugin execution on the remote host for
its own output and return code.
The code is very basic and may not work on your particular
system without some tweaking. I just haven't put a lot of effort
into this addond. Most Linux users should be able to compile
NRPE and the check_nrpe plugin with the following commands...
The binaries will be located in the src/ directory after you
run 'make all' and will have to be installed manually somewhere
on your system.
NOTE: Since the check_nrpe plugin and nrpe daemon run on different
machines (the plugin runs on the Nagios host and the daemon
runs on the remote host), you will have to compile the nrpe
daemon on the target machine.
The check_nrpe plugin should be placed on the Nagios host along
with your other plugins. In most cases, this will be in the
The nrpe program and the configuration file (nrpe.cfg) should
be placed somewhere on the remote host. Note that you will also
have to install some plugins on the remote host if you want to
make much use of this addon.
Running Under INETD
If you plan on running nrpe under inetd and making use of TCP
wrappers, you need to do two things:
1) Add a line to your /etc/services file as follows (modify the port
number as you see fit)
nrpe 5666/tcp # NRPE
2) Add an entry to /etc/inetd.conf as follows
nrpe stream tcp nowait <user> /usr/sbin/tcpd <nrpebin> -i <nrpecfg>
- Replace <user> with the name of the user that nrpe should run as
- Replace <nrpebin> with the path to the nrpe binary on your system.
- Replace <nrpecfg> with the path to the nrpe config file on your system.
3) Restart inetd will the following command
4) Add entries to your /etc/hosts.allow and /etc/hosts.deny
file to enable TCP wrapper protection for the nrpe service.
This is optional, although highly recommended.
Note: If you run nrpe under inetd, the server_port and
allowed_hosts variables in the nrpe.cfg configuration
file are ignored.
Configuring Things On The Nagios Host
Examples for configuring the nrpe daemon are found in the sample
nrpe.cfg file included in this distribution. That config file
resides on the remote host(s) along with the nrpe daemon. The
check_nrpe plugin gets installed on the Nagios host. In order
to use the check_nrpe plugin from within Nagios, you'll have
to define a few things in the host config file. An example
command definition for the check_nrpe plugin would look like this:
command[check_nrpe]=/usr/local/nagios/libexec/check_nrpe $HOSTADDRESS$ -c $ARG1$
In any service definitions that use the nrpe plugin/daemon to
get their results, you would set the service check command portion
of the definition to something like this:
where "yourcommand" is a name of a command that you define in
your nrpe.cfg file on the remote host (see the docs in the
sample nrpe.cfg file for more information).
If you have questions about this addon, or problems getting things
working, first try searching the nagios-users mailing list archives.
Details on searching the list archives can be found at
If all else fails, you can email me and I'll try and respond as
soon as I get a chance.
-- Ethan Galstad (email@example.com)