NRPE installation and configuration in remote Linux

NRPE installation Nagios remote plugin executor. 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.

Note: The NRPE addon requires that Nagios Plugins must be installed on the remote Linux machine. Without these, the NRPE daemon will not work and will not monitor any services.

Related Topics:

Prepare Linux server for Nagios installation

Nagios 4.1.1 Installation in RHEL 7 / Centos 7

NSClient++ installation in Windows machine

Step 1: NRPE Installation dependencies first

~]# yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel

 

Step 2: Create Nagios user

~]# useradd nagios 
~]# passwd nagios

Step 3: Installation Nagios plugins

cd /tmp 
wget https://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz

Step 4: Extract Nagios plugins, compile and install

~]# tar -xzvf nagios-plugins-2.1.1.tar.gz 
~]# ll -l 
~]# cd nagios-plugins-2.1.1 
~]# ./configure 
~]# make 
~]# make install 
~]# chown nagios.nagios /usr/local/nagios 
~]# chown -R nagios.nagios /usr/local/nagios/libexec

Step 5:  We have to run nrpe agent under the xinted service

~]# yum install xinetd

Step 6: Download and install NRPE package

To install NRPE deamon and run NRPE as a service using xinetd

~]# cd /tmp  
~]# wget http://garr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz 
~]# tar xzf nrpe-2.15.tar.gz 
~]# cd nrpe-2.15 
~]# ./configure 
~]# make all 
~]# make install-plugin 
~]# make install-daemon 
~]# make install-daemon-config 
~]# make install-xinetd

Step 7: Configure the NRPE service

Now open /etc/xinetd.d/nrpe file and add the localhost and IP address of the Nagios Server

 

 

 

 

 

 

Open /etc/services

~]# vi /etc/services
~]# nrpe            5666/tcp                 #NRPE client entry
~]# service xinetd restart

Step 8: Verify NRPE is listening

~]# netstat -at | grep nrpe

Step 9: Configure the Firewall to allow the NRPE port number

~]# firewall-cmd --zone-public --add-port=5666/tcp -permanent
~]# firewall-cmd --reload

Done..!!!

Go to Nagios Server then follow the below steps verify NRPE is working. Now verify you can able to run the commands on remote client using NRPE.

~]# cd /usr/local/nagios/libexec  
~]# ./check_nrpe -H <Remote host IP>

Sample output

~]# NRPE v2.15

Now configure your services to monitor.

See Video Tutorial for details installation and configuration

NRPE installation NRPE installation NRPE installation

Thanks for your wonderful Support and Encouragement