Installing Linux NRPE Agent on RHEL 7/Centos 7

This document for how to installing Linux NRPE Agent on RHEL 7/Centos 7. It is for use by Nagios Administrators who want to monitor the remote Linux Servers with Nagios core / Nagios XI.

NRPE stands for Nagios Remot plugin executor which will execute on remote Linux machine and collect the data when Nagios server send an request NRPE will send an collected stats data to Nagios Server.

This will automatically number of things configure for you:

  1. Modify the distro’s package manager repositories.
  2. Installing the prerequisite packages
  3. Creating required users and groups
  4. Defining services for NRPE daemon(XINETD)
  5. Compiling and installing the agents and few plugins
  6. It will configuring the firewall
  7. Configuring the ports in /etc/services
  8. Configuring the agent.

Installing Linux NRPE agent in RHEL 7 / Centos 7

Installing the dependencies first on remote server by using yum command

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

Create nagios user and set password

~]#useradd nagios

~]#passwd nagios

Now have to download and  install nagios plugin

~]#wget http://www.nagios-plugins.org/download/nagios-2.0.3.tar.gz

Extract the nagios plugins

~]#tar -xzvf nagios-2.0.3.tar.gz

~]#cd nagios-2.0.3

Now compile and install

~]#./configure
~]#make
~]#make install

After installation an nagios plugin, give the permissions as below shown.

~]# chown nagios.nagios /usr/local/nagios 
~]# chown -R nagios.nagios /usr/local/nagios/libexec

Install the nrpe daemon

~]#yum install -y xinetd

Download the Linux NRPE Agent to the /tmp directory on the remote Linux machine you wish to monitor

~]#wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz

Unpack the installation archive which you have downloaded

~]#tar -xzvf linux-nrpe-agent.tar.gz
~]#cd linux-nrpe-agent

Run the wrapper script (fullinstall.sh) as root credentials

linux nrpe agent installing 1

NRPE installation process

Type yes and hit the Enter, Enter your Nagios Server IP Address.

linux nrpe agent installing 2

Provide Nagios Server IP Address

installing Linux NRPE Agent complete.

You have to goto nrpe.cfg file and add your nagios server ip address

~]#cd /usr/local/nagios/etc/

~]#vi nrpe.cfg
linux nrpe agent installing 4

Add Nagios Server IP to allow

Goto /etc/xinetd.d/nrpe for verify your nagios server ip address.

~]#vi /etc/xinted.d/nrpe
linux nrpe agent installing 3

Include Nagios Server IP

You can verify ports in /etc/services

~]#vi /etc/services
linux nrpe agent installing ports

Add NRPE port numbers to communicate with services

Now restart the NRPE daemon

~]#systemctl restart xinetd.service

Check nrpe port listening or not?

linux nrpe agent installing 5

Verify port is listening state

Now you have successfully installed and configured Linux NRPE Agent on remote Linux machine.

Conclusion

Nagios Remote Plugin executor is used to monitor remote Linux server (Nagios Client). After installing Linux NRPE agent we have to allow Nagios server IP from NRPE. NRPE agent send data using 5666, 5667 and 5668 ports.

Thanks for the read. Please provide your valuable feedback via comments.

Related Articles

Customise Linux Server for Nagios Server Installation

Monitoring Raid controller using Nagios

Thanks for your wonderful Support and Encouragement

blank

Ravi Kumar Ankam

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn More

1 Response

  1. blank Prateek Singhal says:

    I have installed nrpe agent on my client but the port 5666 for nrpe is not listening and i think this is where i am lacking. Please suggest where i am committing a mistake possibly. Also share the procedure to remove the nrpe agent if not required.

Leave a Reply

Your email address will not be published. Required fields are marked *