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…

  1. Install nrpe on your monitoring target:
    sudo apt-get install nagios-nrpe-server
    
  2. Restrict access to the NRPE service:
    sed -i 's|allowed_hosts=.*|allowed_hosts=192.168.1.0/24|g' ...

Get Linux Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.