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, 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.
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, and any other Debian-based distribution like Linux Mint or elementary OS.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
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.