Install Nagios NRPE Agent on CentOS 8

|
Last Updated:
|
|

Follow through this guide to learn how to install Nagios NRPE agent on CentOS 8. In order to execute Nagios plugins that monitors various system services and metrics on a remote host, you need to install Nagios Remote Plugin Executor (NRPE).

Installing Nagios NRPE Agent on CentOS 8

Nagios NRPE agents can be installed from the EPEL repos directly using the package manager or can be build from the source.

Install Nagios NRPE Agents From EPEL Repos

Install EPEL repos on CentOS 8 by running the command;

dnf install epel-release

Once the EPEL repos are installed, run DNF list command to check available NRPE packages.

dnf list nrpe
Last metadata expiration check: 0:45:46 ago on Fri 18 Oct 2019 04:15:03 PM EDT.
Available Packages
nrpe.x86_64                                                              3.2.1-9.el8                                                               epel

NRPE 3.2.1 is available for installation. The command below installs NRPE agent on CentOS 8.

dnf install nrpe

Confirm installed version once the installation completes.

nrpe -V
NRPE - Nagios Remote Plugin Executor
Version: 3.2.1

Running NRPE

Run the commands below to start and enable nrpe to run on system boot.

systemctl enable nrpe --now

To check the status of NRPE agent;

systemctl status nrpe
● nrpe.service - Nagios Remote Plugin Executor
   Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-10-18 17:16:54 EDT; 25s ago
     Docs: http://www.nagios.org/documentation
 Main PID: 26565 (nrpe)
    Tasks: 1 (limit: 11523)
   Memory: 740.0K
   CGroup: /system.slice/nrpe.service
           └─26565 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f

Oct 18 17:16:54 centos8.kifarunix-demo.com systemd[1]: Started Nagios Remote Plugin Executor.
Oct 18 17:16:55 centos8.kifarunix-demo.com nrpe[26565]: Starting up daemon
Oct 18 17:16:55 centos8.kifarunix-demo.com nrpe[26565]: Server listening on 0.0.0.0 port 5666.
Oct 18 17:16:55 centos8.kifarunix-demo.com nrpe[26565]: Server listening on :: port 5666.
Oct 18 17:16:55 centos8.kifarunix-demo.com nrpe[26565]: Listening for connections on port 5666
Oct 18 17:16:55 centos8.kifarunix-demo.com nrpe[26565]: Allowing connections from: 127.0.0.1,::1

Open NRPE Port on FirewallD

NRPE uses port TCP 5666 by default. If firewallD is running, open this port to allow external access esp from Nagios Monitoring server.

firewall-cmd --add-port=5666/tcp --permanent
firewall-cmd --reload

Install Nagios NRPE Agent from Source Code

You can as well build Nagios NRPE agent from the source code. Follow the guide below to learn how to build Nagios NRPE Agent from the source.

Install Nagios NRPE Agent on RHEL/CentOS/Oracle Linux

Once you have installed Nagios, you can the configure it to define the specific nagios plugins to execute for Nagios host monitoring.

Configure NRPE Agent

The Nagios NRPE configuration is also discussed in the guide above except that, the configuration file for NRPE agent installed from EPEL repos is /etc/nagios/nrpe.cfg.

That is just it on how to install Nagios NRPE agents on CentOS 8. Hope this guide was informative enough.

Other Nagios Tutorials

Configure Nagios Email Notification Using Gmail

Add Hosts to Nagios Server For Monitoring

Install Nagios Plugins on CentOS 8

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

Leave a Comment