Sunday, October 4, 2015

NRPE installation and configuration in remote linux host

Nagios remote plugin executor

Step 1: Installation dependancies 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 /root/nrpe
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

cd /root/nrpe
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 Monitoring Server.

Open /etc/services
nrpe            5666/tcp                 NRPE


service xinetd restart

Step 8: Verify NRPE is listening 

netstat -at | grep nrpe

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

iptables -A INPUT -p tcp -m tcp --dport 5666 -j ACCEPT
service iptables save



Done..!!!





No comments:

Post a Comment