Nagios: 4.1.1 NRPE Plugin installation on Ubuntu 15.04, 14.04, 12.04 & LinuxMint systems.
This article will help you to install NRPE on Ubuntu 16.04, 15.04, 14.04, 12.04 & LinuxMint systems.
NRPE
Nagios Remote Plugin Executor (NRPE) is used to execute the Nagios plugins on a remote machine
1. Install NRPE and Nagios Plugins
NRPE is available under default apt repositories of Ubuntu systems. Execute the following command to install it
# apt-get install nagios -nrpe-server nagios -plugins
2. Configure NRPE
In NRPE configuration, first we need to nrpe to which nagios servers it accepts requests, For example your nagios server ip is 192.168.1.100, then add this ip to allowed hosts list. Edit NRPE configuration file /etc/nagios /nrpe.cfg and make changes like
# vi /etc /nagios /nrpe.cfg
# allowed_hosts=127. 0.0.1, 192.168.1.84
Now restart NRPE service. Now its ready to listen requests from Nagios server
# /etc/init . d/nagios -nrpe-server restart
Let’s goto to Nagios server and verify that your Nagios server can communicate with NRPE service properly. Execute following command from nagios server plugin directory, and we are assuming that your nrpe client-server ip is 192.168.1.11.
# check_nrpe -H 192.168.1.143
NRPE v2. 15
# allowed_hosts=127. 0.0.1, 192.168.1.84
The output “NRPE v2. 15” shows that nagios server successfully communicated with nrpe .
Add Check Commands in NRPE
All the services check commands with the nagios plugins packages, which is by default installed in /usr/lib/nagios/plugins/ for 32 bit systems. Default installation adds few commands in configuration file . Add more commands as per your requirements like below
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/xdva1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
4. Start/Stop NRPE Service
Use following commands to start, stop or restart nrpe service. Each time we make any changes in configuration file required to restart service
# sudo /etc/init.d/nagios-nrpe-server stop
# sudo /etc/init.d/nagios-nrpe-server start
# sudo /etc/init.d/nagios-nrpe-server restart
Comments
Post a Comment