Thursday, October 15, 2020

How to Install NRPE on Centos 6.4

 


NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with some of the Windows agent addons, so you can execute scripts and check metrics on remote Windows machines as well.

Check how to install Nagios Core here.

Step 1: Install first the required package for NRPE

yum install -y gcc glibc glibc-common openssl openssl-devel perl wget

Step 2: Download the source, extract, compile and install 

Download the package.

cd /tmp

wget --no-check-certificate -O nrpe.tar.gz

https://github.com/NagiosEnterprises/nrpe/
archive/nrpe-3.2.1.tar.gz

Extract 

tar xzf nrpe.tar.gz

cd nrpe-nrpe-3.2.1/

 Compile & Install

./configure --enable-command-args

make all

make install-groups-users

make install

make install-config

Update Services File and finish the installation.

echo >> /etc/services

echo '# Nagios services' >> /etc/services

echo 'nrpe    5666/tcp' >> /etc/services

make install-init

Step 3: Configure firewall 

Configure firewall rules and open port 5666 for NRPE.

iptables -I INPUT -p tcp --destination-port 5666 -j
 ACCEPT

service iptables save

service iptables restart

Step 4: Update nrpe.cfg 

The allowed_hosts on Nagios Server doesn't need to change but make sure to configure it and put the Nagios Server IP when you installed NRPE on Nagios clients.

vi /usr/local/nagios/etc/nrpe.cfg

allowed_hosts=127.0.0.1,192.168.1.67

dont_blame_nrpe=1

Step 5: Start the service 

Start the NRPE service then run test.

start nrpe

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1

The result will be:

NRPE v3.2.1



 


No comments:

Post a Comment