this is obsolete doc -- see http://doc.nethence.com/ instead
Enabling nagios nrpe scripts on targets (running the nrpe service)
On the target (nrpe server)
Install the NRPE service & plugins, on Debian,
apt-get install \
nagios-nrpe-server \
nagios-nrpe-plugin \
nagios-plugins-basic \
nagios-plugins-standard
update-rc.d nagios-nrpe-server defaults
on RHEL6 (EPEL is needed),
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -ivh epel-release-latest-6.noarch.rpm
yum install \
nrpe \
nagios-plugins-nrpe \
nagios-plugins-disk \
nagios-plugins-load \
nagios-plugins-swap \
nagios-plugins-procs \
nagios-plugins-time \
nagios-plugins-uptime \
nagios-plugins-users
chkconfig nrpe on
The provided nagios plugins are installed there:
(Debian) /usr/lib/nagios/plugins/
(RHEL) /usr/lib64/nagios/plugins/
Fetch and authorize additional custom scripts for example there,
(custom) /root/bin/
See http://pbraun.nethence.com/net/nagios_custom_scripts.html
Check that everything is working locally, calling the scripts/plugins directly e.g.,
(custom) /root/bin/diskusage4nagios.bash
(Debian) /usr/lib/nagios/plugins/check_disk -w 10% -c 5%
(RHEL) /usr/lib64/nagios/plugins/check_disk -w 10% -c 5%
Allow the server to connect and enable the scripts and plugins into NRPE configuration,
cp /etc/nagios/nrpe.cfg /etc/nagios/nrpe.cfg.dist
vi /etc/nagios/nrpe.cfg
allowed_hosts=127.0.0.1, NAGIOS_SERVER
(custom) command[diskusage4nagios]=/root/bin/diskusage4nagios.bash
(custom) command[check_omreport]=/root/bin/omreport.bash
(RHEL) command[disk]=/usr/lib64/nagios/plugins/check_disk -w 10% -c 5%
(RHEL) command[load]=/usr/lib64/nagios/plugins/check_load -r -w 15,10,5 -c 30,25,20
(RHEL) command[swap]=/usr/lib64/nagios/plugins/check_swap -w 90 -c 80
(RHEL) command[memsh]=/usr/lib64/nagios/plugins/check_mem.sh -W 10 -C 20
(RHEL) command[check_memory]=/usr/lib64/nagios/plugins/check_mem -w 80 -c 90
reload the NRPE service, on Debian,
/etc/init.d/nagios-nrpe-server restart
on RHEL,
service nrpe restart
Make sure port TCP 5666 is open or disable the firewall on the system.
On the nagios server (nrpe client)
target=hostname
Check that remote commands executes calling check_nrpe manually,
/usr/lib/nagios/plugins/check_nrpe -H $target
/usr/lib/nagios/plugins/check_nrpe -H $target -c diskusage4nagios
/usr/lib/nagios/plugins/check_nrpe -H $target -c disk
Configure the NRPE global wrapper,
define command{
command_name nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Configure the host and add the service,
define host{
use generic-host
host_name $target
alias Cliff - Integration server
address 10.0.0.59
}
define service{
use generic-service
host_name $target
service_description mount point usage
check_command nrpe!diskusage4nagios
}
define service{
use generic-service
host_name $target
service_description disk usage
check_command nrpe!disk
}
reload the nagios service, on Debian,
/etc/init.d/nagios3 reload