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.

 

Downloading, Compiling, And Installing The Nagios Plugins

NRPE need plugins to operate properly. Before we dive into configuration, download and build the Nagios-plugins (visit Nagios-Plugins.org/downloads to find the latest version of the plugins and adjust the version number in the commands accordingly):

cd /tmp
wget https://www.nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar zxvf nagios-plugins-2.0.3.tar.gz
cd /tmp/nagios-plugins-2.0.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

This completes installing Nagios Plugins.

 

 

Final Thoughts

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

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

2.75 (4)
Article Rating (4 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
Nagios XI - Installing The Linux Agent
Viewed 2449 times since Wed, Jan 27, 2016
Nagios XI - How To Monitor Apache ActiveMQ With Nagios XI
Viewed 7721 times since Wed, Jan 27, 2016
NRPE - v3 check_nrpe Config File
Viewed 3209 times since Fri, Jun 24, 2016
NRPE - Ubuntu / Debian Agent Installation
Viewed 1872 times since Wed, Jan 27, 2016
NRPE - Agent and Plugin Explained
Viewed 427 times since Fri, Jul 14, 2017
Nagios XI - Installing the XI Mac OS/X Agent
Viewed 1657 times since Wed, Jan 27, 2016
NRPE - How to install NRPE from source without xinetd on CentOS 6.
Viewed 3910 times since Wed, Apr 15, 2015
NRPE - Turn Off XINETD Logging On Success
Viewed 919 times since Tue, Mar 7, 2017
NRPE - How To Install NRPE v3 From Source
Viewed 43049 times since Fri, Jun 3, 2016
Nagios XI - Monitoring Hosts Using NRPE
Viewed 3059 times since Thu, Jan 28, 2016