NRPE (Nagios Remote Plugin Executor) is a Nagios plugin used to remotely execute plugins and scripts on remote hosts. This allows you to monitor resources, such as disk usage, CPU load, and network activity, on remote hosts. In this article, we will show you how to install NRPE on CentOS/RHEL 9/8.
Before installing NRPE, you must have the following prerequisites:
- A server running CentOS/RHEL 9/8/7.
- A user account with sudo or root privileges.
- The yum package manager must be installed on your system.
Step 1: Install NRPE Package
To install the NRPE package, run the following command as root or with sudo privileges:
sudo yum install nrpe nagios-plugins-nrpe -y
Step 2: Configure NRPE
After the installation is complete, you need to configure NRPE. The NRPE configuration file is located at /etc/nagios/nrpe.cfg. Open the file using your favorite text editor and make the following changes:
- Change the allowed_hosts directive to allow connections from your Nagios server. For example, if your Nagios server has an IP address of 192.168.1.100, you would add the following line to the configuration file:
- Define the commands that NRPE will execute. The commands are defined in the command[ ] sections of the configuration file. For example, to define a command to check the load average on the remote host, you would add the following line to the configuration file:
Step 3: Start and Enable NRPE Service
To start and enable the NRPE service, run the following commands:
sudo systemctl start nrpe
sudo systemctl enable nrpe
Step 4: Test NRPE Configuration
Finally, you can test the NRPE configuration by running the following command on your Nagios server:
If the NRPE configuration is correct, the output should be similar to the following:
In this article, we showed you how to install NRPE on CentOS/RHEL 9/8. NRPE allows you to monitor resources on remote hosts from your Nagios server. With the steps outlined in this article, you should be able to install NRPE on your server and get started with monitoring your network.