Home » Categories » Multiple Categories

NRPE - How to install NRPE from source without xinetd on CentOS 6.

Overview

This guide is intended for administrators who would like to run NRPE without using xinetd. As xinetd does provide some level of security, it is not recommended to do this.

 

Install and Configure NRPE to run without xinetd

First, we need to install NRPE - I will use version 2.15 for the guide below.
I used the following guide as a point of reference: https://github.com/NagiosEnterprises/nrpe/blob/master/docs/NRPE.pdf
This guide assumes that NRPE is being compiled on Nagios 4.x.

Download the tarball and extract it in your /tmp directory:

cd /tmp
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz/download
tar xfz download
cd nrpe*

Setup the nagios user:

useradd nagios
passwd nagios

Install NRPE pre-requisites:

yum install mod_ssl openssl-devel gcc make openssl perl

Configure and make NRPE. This will create the /usr/local/nagios directory, which is where NRPE will be located:

./configure
make all
make install

Make the NRPE config directory, and setup the example config file:

mkdir /usr/local/nagios/etc
cp sample-config/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg
chown -R nagios:nagios /usr/local/nagios/etc

Open port 5666 in your firewall to allow your Nagios server through. The rule below limits access to a particular source IP:

iptables -A INPUT -s <nagiosserverip> -p tcp -m tcp --dport 5666 -m state --state NEW,ESTABLISHED -j ACCEPT
service iptables save

At this point, NRPE is ready to start:

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

 

Ensure that NRPE is up and running

ps -ef | grep nrpe | grep -v grep

The output of the above command should show one instance of NRPE running on the server.

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

The above command will check to see whether NRPE is responding using the installed check_nrpe plugin. The output should be as follows:



 

 

Additional Information

  • You may edit the /usr/local/nagios/etc/nrpe.cfg file to change the configuration of the NRPE daemon. For more information about the configuration options, please see the NRPE Guide.

  • To have NRPE start on boot, consider adding an entry similar to the following to /etc/rc.local:
    echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.local
  • If you already have a working NRPE install, you can likely remove xinetd and start NRPE manually:
    yum remove xinetd
    /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

3 (2)
Article Rating (2 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
NRPE - How To Uninstall NRPE
Viewed 33843 times since Thu, Aug 10, 2017
NRPE - Upgrading To NRPE v3 From Source
Viewed 12630 times since Mon, Jul 11, 2016
NRPE - Packet Size Explained
Viewed 26345 times since Thu, Jun 30, 2016
NRPE - How To Install NRPE v4 From Source
Viewed 333991 times since Fri, Jun 3, 2016
NRPE - How to install NRPE
Viewed 113052 times since Wed, Dec 17, 2014
NRPE - v3/v4 Compatibility With Previous Versions
Viewed 38690 times since Fri, Jun 24, 2016
Nagios XI - Monitoring AIX With Nagios
Viewed 6650 times since Thu, Jan 28, 2016
NRPE - Linux Cached Memory Not Added to Free Memory
Viewed 7936 times since Wed, Jan 27, 2016
Nagios XI - Upgrading The Linux NRPE Agent
Viewed 7268 times since Wed, Aug 30, 2017
NRPE - Agent and Plugin Explained
Viewed 56753 times since Fri, Jul 14, 2017