Nethence Documentation Lab Webmail Your IP BBDock  


Those documents are obsolete, please use the Nethence Documentation instead.

HomeUnixWindowsOracleObsoleteHardwareDIYMechanicsScriptsConfigsPrivate

Setting up NRPE on Nagios server and clients
 

Requirements on the server
Install NRPE,
apt-get install nagios-nrpe-server nagios-nrpe-plugin
 
Register the check_nrpe command into Nagios,
cd /etc/nagios/
vi commands.cfg
#
# NRPE
#
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Note. No need to add a plugin to /usr/lib/nagios/plugins/. The plugin is located on the host running the nrpe agent. No need to configure commands in /etc/nagios-plugins/config/ either.
 
Setting up the alarms on the server
Make sure the NRPE calls work from the server to the client. Execute the script remotely to check the communication and that the script are working fine,
host=host_ 
/usr/lib/nagios/plugins/check_nrpe -H $host_ 
/usr/lib/nagios/plugins/check_nrpe -H $host_ -c check_load
/usr/lib/nagios/plugins/check_nrpe -H $host_ -c check_space
/usr/lib/nagios/plugins/check_nrpe -H $host_ -c check_swap
/usr/lib/nagios/plugins/check_nrpe -H $host_ -c check_memsh
#/usr/lib/nagios/plugins/check_nrpe -H $host_ -c check_omreport
/usr/lib/nagios/plugins/check_nrpe -H $host -c diskusage4nagios
unset $host_
 
Add the nrpe call for the host (assuming the host is alreay defined),
cd /etc/nagios/conf.d/
vi hosts.cfg
define service{
use generic-service
host_name host 
service_description Open Manage disk status
check_command check_nrpe!check_omreport
}

define service{
use generic-service
host_name host 
service_description memory
check_command check_nrpe!check_mem
}

define service{
use generic-service
host_name host 
service_description cpu load
check_command check_nrpe!check_load
}

define service{
use generic-service
host_name host 
service_description disk usage
check_command check_nrpe!check_space
}

define service{
use generic-service
host_name host 
service_description should not swap
check_command check_nrpe!check_swap
}

define service{
use generic-service
host_name host 
service_description memory
check_command check_nrpe!check_memsh
}
 
Reload the nagios configuration on the server,
/etc/init.d/nagios3 reload
 
Troubleshooting
If you get this error,
CHECK_NRPE: Socket timeout after 10 seconds.
==> make sure nrpe server is running on the client and its port e.g. 5999 is open
 
If you get this error,
CHECK_NRPE: Error - Could not complete SSL handshake.
==> allow the nagios server to connect on client's nrpe.cfg
 
References
Surveiller vos serveurs Linux avec Nagios et NRPE
Configuring Nagios to monitor remote load, disk, swap etc using NRPE
 

Last update: Apr 08, 2016