
For effective server monitoring with Nagios, accessing detailed system metrics and service status on remote machines is crucial. This is where the Nagios Remote Plugin Executor (NRPE) plays a vital role. Installing and configuring the NRPE agent on your target servers, such as Rocky Linux 8 systems, allows the central Nagios server to execute plugins locally on the remote machine and retrieve the results.
Setting up NRPE on Rocky Linux 8 involves several key steps to ensure secure and reliable communication between your monitoring server and the remote host.
First, it’s essential to ensure your Rocky Linux 8 system is up-to-date before beginning the installation. NRPE packages are commonly found in the Extra Packages for Enterprise Linux (EPEL) repository, so you’ll likely need to enable this repository if it’s not already configured on your system. Once EPEL is available, you can install the nagios-nrpe
package along with the necessary Nagios plugins (nagios-plugins-all
is often recommended for a comprehensive set).
After installation, the primary task is configuring the nrpe.cfg
file, typically located in /etc/nagios/
. A critical security step here is configuring the allowed_hosts
directive. This setting is paramount as it explicitly lists the IP addresses of the Nagios server(s) permitted to connect to this NRPE agent. Failing to set allowed_hosts
correctly can leave your system vulnerable. Within this configuration file, you will also define the commands that the NRPE agent can execute. These commands link a short name used by the Nagios server (e.g., check_load
) to the actual plugin execution command and its arguments on the Rocky Linux host.
Connectivity is next. By default, NRPE communicates on port 5666. You must open this port in your Rocky Linux 8 firewall to allow inbound connections from your Nagios server. Using firewall-cmd
is the standard way to manage firewall rules on Rocky Linux.
Once the configuration file is edited and the firewall rules are in place, you need to start the nrpe
service and enable it to start automatically on boot. This ensures the agent is running and persistent across reboots.
Finally, test the installation from your Nagios server using the check_nrpe
plugin. This command verifies that the Nagios server can connect to the agent and execute a basic command, confirming the setup is functional.
Successfully installing and configuring the NRPE agent on Rocky Linux 8 is a fundamental step for comprehensive remote server monitoring with Nagios, providing valuable insights into the health and performance of your systems.
Source: https://kifarunix.com/install-nagios-nrpe-agent-on-rocky-linux-8/