Kamis, 22 Agustus 2024

How To Install NRPE on CentOS 7

How To Install NRPE on CentOS 7 How To Install NRPE on CentOS 7


Prerequisites

Before installing NRPE, you must have the following prerequisites:
  • A server running CentOS 7.
  • A user account with sudo or root privileges.

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:


 allowed_hosts=192.168.1.100

  • 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:


 command[check_root_disk]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /


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:


$ /usr/lib64/nagios/plugins/check_nrpe -H 

If the NRPE configuration is correct, the output should be similar to the following:


Output


NRPE v4.1.0


Conclusion

In this article, we showed you how to install NRPE on CentOS 7. 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.

Tidak ada komentar: