In this tutorial, we will show you how to install NRPE on Ubuntu 20.04 LTS. For those of you who didn’t know, NRPE is a client-side application for executing Nagios plugins. The Nagios server communicates with the remote system using this plugin. NRPE must be installed on all the remote systems that need to monitor by the Nagios server. It allows the gathering of metrics such as system load, disk utilization, and uptime, etc.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Nagios Client (NRPE) on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Install NRPE on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following
apt commands in the terminal.
sudo apt update sudo apt upgrade
Step 2. Installing NRPE (Nagios Remote Plugin Executor) on Ubuntu 20.04.
NRPE packages are available under the default repositories on Ubuntu systems. Now run the following command to install it:
sudo apt install nagios-nrpe-server nagios-plugins
Once installed, verify the status of the NRPE agent using the following command:
sudo systemctl status nagios-nrpe-server
Step 3. Configure NRPE.
Now we edit the NRPE configuration file
/etc/nagios/nrpe.cfg and make the necessary changes like below:
sudo nano /etc/nagios/nrpe.cfg
Add your Monitor server address to the
allowed_hosts parameter as a comma-separated list in the appropriate section:
Save the changes and exit the configuration file. For the changes to take effect, be sure to restart the NRPE agent daemon:
sudo systemctl restart nagios-nrpe-server
You can verify the connection from Nagios server to remote use
check_nrpe the script, which is available on the Nagios core server:
check_nrpe -H 192.168.1.11
Step 4. Configure Firewall.
The default NRPE service listens on port 5666. Use the following commands to open the firewall port for NRPE service:
sudo firewall-cmd --permanent --zone=public --add-port=5666/tcp sudo firewall-cmd --reload
Congratulations! You have successfully installed NRPE. Thanks for using this tutorial for installing the Nagios Client (NRPE) on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official Nagios website.