NRPE is a Unix client for executing plugins on remote hosts.
It is distributed as
•rpm-packages
•deb-packages
•portable source-code.
NRPE is used in combination with a set of local plugins. By default in op5 Monitor the plugins are placed in:
/opt/plugins
There are only a few plugins shipped with the op5 NRPE packages but you may use the ones located on the op5 Monitor server.
Installing NRPE
To install NRPE
1 Download the package for your environment from the download section at the support site at www.op5.com
2 Put the package to the host you like to install it on.
3 Install the package the same way as you do normally with packages on that host.
Configuring NRPE
Before we can start use the NRPE agent for monitoring with op5 Monitor we need to configure the agent.
The NRPE agent is located in:
•/etc/nrpe.conf
Table 2 NRPE main configuration file settings
Setting | Description |
server_port | The port NRPE should listen on. Default: 5666 |
allowed_hosts | Add the IP of you OP5 Monitor server on this line multiple addresses can be separated with , ie: allowed_hosts=1.2.3.4,1.2.3.5 Make sure you do not add any space between the comma (,). Default: empty |
nrpe_user | The user the NRPE daemon is executed as. Default: nobody |
nrpe_group | The group the NRPE daemon is executed as. Default: nobody |
debug | Set to 1 if you need to debug the NRPE. Default: 0 |
command_timeout | The default time out, in seconds, a check shall have. Default: 60 |
dont_blame_nrpe | Set to 1 to be able to send arguments to NRPE. Default: 0 |
Adding commands to NRPE
NRPE comes with a few predefined commands. Those commands are located in:
/etc/nrpe.d/op5_commands.cfg
You may add your own commands and you should do that in your own file in:
/etc/nrpe.d/
You must set .cfg as extension to your configuration file or else it will not be loaded into NRPE when the daemon is restarted.
NRPE command definition
The NRPE command definitions is divided into two parts.
Table 3 NRPE command parts
Part | Description |
command[name] | The string between the square brackets will be the name of this command. The name is used when you executes the command with check_plugin. Do not use space in the command name. |
/opt/plugins/... | This is the command line used to execute the plugin you are going to use in your command. |
To add a command to NRPE
Here we will add a command that is looking for a process named smsd using the plugin check_procs, which is installed by default.
1 Login to the host you have installed NRPE on as root user over ssh.
2 Create a new configuration file and open it up with your favorite editor.
3 Add a command line looking like this:
command[proc_smsd]=/opt/plugins/check_procs -w 1: -c 2:2 -C smsd
4 Save the file and restart NRPE:
service nrpe restart
Plugins used with NRPE
The only plugin used with NRPE is
•check_nrpe
To use the plugin with the command defined in
Adding commands to NRPE on page 18 you shall use the following command line in your service definition:
/opt/plugins/check_nrpe -H $HOSTADDRESS$ -C proc_smsd