Home » Categories » Multiple Categories

NRPE - How to install NRPE

Installing NRPE Using the Install Script

You must run the following commands as root.

cd /tmp

For CentOS & RHEL 5-7, Fedora 14+, SLES & OpenSUSE 11+, Ubuntu 12+, Debian 6+:

wget http://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz

For CentOS & RHEL 4:

wget http://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent-el4.tar.gz

Unpack the installer, and run the install script:

tar xzf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent
./fullinstall

The script takes care of the following setup:

  • Installs prerequisite packages
  • Creates required users and groups
  • Defines services for xinetd
  • Compiles and installs the NRPE agent and Nagios plugins
  • Configures the firewall (except on SLES)
  • Configures the agent

The script will stop to prompt you once to ask for the IP address(es) for your monitoring server(s).

You will need to type either a single address or multiple addresses separated by spaces. This will configure the xinetd superdaemon to allow connections from those addresses to the NRPE agent.

You now have NRPE installed. You may remove any installation files in the tmp directory.

 

This video covers the steps above.

 

 

 

Installing NRPE v2.15 From Source

This document describes how to install and configure NRPE v2.15 from source for use with Nagios Core/XI. The linux-nrpe-agent that ships with Nagios XI is only supported on CentOS, RHEL, OpenSUSE, SLES, Ubuntu, and Debian. Most monitored environments consist of many different distributions, therefore may need to compile NRPE and its associated plugins.

This procedure is intended for Nagios XI administrators who are new to NRPE or Nagios XI and have to use a source-based install method for NRPE, usually due to unsupported Linux distributions or security restrictions in corporate environments.

NRPE v3 has been released and you should instead refer to the following KB article for installing NRPE from source.

Documentation - How To Install NRPE v3 From Source

Only proceed with the steps below if you want to install v2.15.

 

Prerequisites

Make sure that you have the following packages installed:

gcc glibc glibc-common openssl-devel perl

 

Downloading the Source

On the remote host (client system), log in as the root user to download and extract the NRPE tarball:

Type:

cd /tmp
wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-2-15.tar.gz
tar zxvf nrpe-2-15.tar.gz

 

Compile and Installation

To compile and install NRPE, run the following commands:

Type:

useradd nagios
cd nrpe-nrpe-2-15
./configure --enable-command-args
make
make install

Note that if you want to pass arguments through NRPE you must specify this in the configuration option as indicated above. If you prefer to you can ommit the --enable-command-args flag. Removing this flag will require that all arguments be explicitly set in the nrpe.cfg file on each server monitored.

The check_nrpe plugin will install into  /usr/local/nagios/libexec by default.

Copy the sample nrpe.cfg file to your remote hosts' NRPE config directory:

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

 

Install xinetd

Once NRPE has been installed, you need to set up an init system - typically this is xinetd.

Many linux distributions come with xinetd pre-installed.

CentOS/RHEL/Fedora:

yum install xinetd

Ubuntu/Debian:

apt-get install xinetd

Gentoo:

emerge -va xinetd

Arch Linux:

pacman -S xinetd

 

Configure xinetd

At this point, we need a configuration that tells xinetd about NRPE. This configuration is included - change directory to the NRPE source to install it:

cd /tmp/nrpe-nrpe-2-15
make install-xinetd

You should now have a config located at /etc/xinetd.d/nrpe - this file contains an "only_from" directive which specifies which ip addresses are allowed to talk to the daemon. It is a space separated list of ip addresses. Add your Nagios XI server's IP after the only_from setting:

vi /etc/xinetd.d/nrpe

Change:

only_from = 127.0.0.1

To:

only_from = 127.0.0.1 x.x.x.x

Where x.x.x.x equals the IP address of your Nagios server.

Finally, we need to add the NRPE port and service declaration in /etc/services:

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

Let's test NRPE/xinetd to make sure it starts up cleanly:

service xinetd start
cd /usr/local/nagios/libexec
./check_nrpe -H 127.0.0.1

You should see the following output:

NRPE v2.15

 If you get the NRPE version number (as shown above), NRPE and xinetd are installed and configured correctly.

 

Installing Nagios Plugins

NRPE needs plugins to operate properly. Please refer to the following KB article for detailed installation instructions for Nagios Plugins:

Documentation - Installing Nagios Plugins From Source

 

 

Final Thoughts

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

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

2.4 (5)
Article Rating (5 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 - v3 check_nrpe Config File
Viewed 4682 times since Fri, Jun 24, 2016
Nagios XI - How To Monitor Apache ActiveMQ With Nagios XI
Viewed 8237 times since Wed, Jan 27, 2016
NRPE - Agent and Plugin Explained
Viewed 1864 times since Fri, Jul 14, 2017
NRPE - Linux Cached Memory Not Added to Free Memory
Viewed 1764 times since Wed, Jan 27, 2016
Nagios XI - Restarting A Linux Service With NRPE
Viewed 1838 times since Thu, Jan 28, 2016
NRPE - How To Install NRPE v3 From Source
Viewed 61704 times since Fri, Jun 3, 2016
NRPE - Turn Off XINETD Logging On Success
Viewed 1810 times since Tue, Mar 7, 2017
Nagios XI - How to Monitor Apache Cassandra Distributed Databases
Viewed 1774 times since Thu, Jan 28, 2016
Nagios XI - Installing The Linux Agent
Viewed 3581 times since Wed, Jan 27, 2016
Nagios XI - Installing the XI Mac OS/X Agent
Viewed 2175 times since Wed, Jan 27, 2016