===== Configure Remote Hosts Nagios Remote Plugin Executor (NRPE) =====
- You need to install NRPE on every remote host that you want to monitor. NRPE will then communicate with a Nagios server.
sudo apt-get -y install nagios-nrpe-server
- Update the NRPE configuration:
sudo sed -i 's/allowed_hosts=127.0.0.1/allowed_hosts=192.168.0.10/g' /etc/nagios/nrpe.cfg
sudo sed -i 's/command\[/#command\[/g' /etc/nagios/nrpe.cfg
- Add the following commands:
cat > /tmp/mycommands.cfg << EOF
command[check_users]=/usr/lib/nagios/plugins/check_users -w 2 -c 5
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 /
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 2 -c 5 -s Z
command[check_ntp_peer]=/usr/lib/nagios/plugins/check_ntp_peer -H 127.0.0.1 -w 0.5 -c 1
command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20% -c 10%
EOF
sudo cp /tmp/mycommands.cfg /etc/nagios/nrpe.d/
- Restart the NRPE Service
sudo service nagios-nrpe-server restart