Monitoring via NRPE
As I mentioned earlier, a number of plugins, such as check_memory
, collect information from the system itself, which means that they cannot be directly used for monitoring remote systems. As these are often critical things to monitor, there are ways available to indirectly collect that information from remote systems using the Nagios Remote Plugin Executer (NRPE).
NRPE runs on the machine that you'd like to monitor and executes the same commands/plugins which Nagios itself would have. Nagios is then configured to collect data from NRPE rather than collecting data directly.
How to do it…
- Install
nrpe
on your monitoring target:sudo apt-get install nagios-nrpe-server
- Restrict access to the NRPE service:
sed -i 's|allowed_hosts=.*|allowed_hosts=192.168.1.0/24|g' /etc/nagios/nrpe.cfg
- Define any additional checks to run by adding them into
/etc/nagios/nrpe.cfg
:command[check_raid]=/usr/lib/nagios/plugins/check_raid
- Configure your
nagios
server to collect data...