Home » Categories » Multiple Categories

NRPE - How To Install NRPE v3 From Source

Installing NRPE v3 From Source

This document describes how to install and configure NRPE 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.

This guide is broken up into several sections and covers different Linux distributions.

If you only want to install the check_nrpe plugin, refer to the section at the bottom of this KB article.

NRPE 3.0.1 and Nagios Plugins 2.2.0 is what this guide instructs you to install, however future versions should also work fine with these steps.

It is assumed that you are logged onto the machine you are installing NRPE as the root user, or a user with sufficient privileges. All of the steps below were tested on the operating systems (OS) listed after a clean install of the OS. Some OS's like Ubuntu and SUSE have stricter user permissions, in those cases the listed commands have sudo in front of them to ensure you are able to complete the steps. A best effort has been made to ensure if you follow all the relevant steps you will end up with a working installation of NRPE.

 

 

Prerequisites

Make sure that you have the following packages installed.

CentOS | RHEL | Oracle Linux

yum install -y gcc glibc glibc-common openssl-devel perl wget

 

Ubuntu

sudo apt-get update
sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget

 

Fedora 23

dnf install -y gcc glibc glibc-common openssl-devel perl wget

 

SUSE SLES 11.3

cd /tmp
wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP3-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-11.3-1.69.x86_64.rpm'
wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP3-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-SDK-11.3-1.69.x86_64.rpm'
sudo rpm -ivh sle-sdk-release-*
sudo suse_register
sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget

 

SUSE SLES 11.4

cd /tmp
wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP4-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-11.4-1.55.x86_64.rpm'
wget 'https://nu.novell.com/repo/$RCE/SLE11-SDK-SP4-Pool/sle-11-x86_64/rpm/x86_64/sle-sdk-release-SDK-11.4-1.55.x86_64.rpm'
sudo rpm -ivh sle-sdk-release-*
sudo suse_register
sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget

 

SUSE SLES 12

sudo SUSEConnect -p sle-sdk/12/x86_64
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64
sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget

 

SUSE SLES 12.1

sudo SUSEConnect -p sle-sdk/12.1/x86_64
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64
sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget

 

SUSE SLES 12.2

sudo SUSEConnect -p sle-sdk/12.2/x86_64
sudo SUSEConnect -p sle-module-web-scripting/12/x86_64
sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget

 

openSUSE Leap 42.1

sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget

 

Solaris 10

echo 'PATH=/usr/sfw/bin:/usr/ccs/bin:/opt/csw/bin:$PATH' >> $HOME/.profile
echo 'export PATH' >> $HOME/.profile
. $HOME/.profile
pkgadd -d http://get.opencsw.org/now
answer all
answer y
perl -ni.bak -le 'print; print "mirror=http://mirrors.ibiblio.org/opencsw/stable" if /mirror=/' /etc/opt/csw/pkgutil.conf
pkgutil -i autoconf
answer y for remaining questions
pkgutil -i automake
answer y for remaining questions

 

Solaris 11

echo 'export PATH=$PATH:/opt/csw/bin:/usr/xpg4/bin:/usr/sfw/bin' >> ~/.profile
source ~/.profile
pkgadd -d http://get.opencsw.org/now
answer all
answer y
perl -ni.bak -le 'print; print "mirror=http://mirrors.ibiblio.org/opencsw/stable" if /mirror=/' /etc/opt/csw/pkgutil.conf
pkgutil -i autoconf
answer y for remaining questions
pkgutil -i automake
answer y for remaining questions
pkg install gcc-45

 

Debian

All steps on Debian require to run as root. To become root simply run:

su

All commands from this point onwards will be as root.

apt-get update
apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget

 

FreeBSD

pkg install -y wget autoconf automake gettext gcc openssl openssl-devel libmcrypt

 

Apple OS X

First, make sure Xcode is installed. If it is not installed visit the App Store and install Xcode (3.8GB download).

sudo xcodebuild -license
View the agreement and then type agree
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Press Return to continue
brew install openssl
brew link openssl --force

 

 

Downloading the Source

CentOS | RHEL | Ubuntu | Fedora | openSUSE | SUSE SLES | Solaris 11 | Oracle Linux | Debian | FreeBSD

cd /tmp
wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/3.0.1.tar.gz
tar xzf nrpe.tar.gz

 

Apple OS X

cd /tmp
curl -L -o nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/3.0.1.tar.gz
tar xzf nrpe.tar.gz

 

Solaris 10

cd /tmp
wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/3.0.1.tar.gz
gunzip -c nrpe.tar.gz | tar -xf -

 

 

Compile

Note that if you want to pass arguments through NRPE you must specify this in the configuration option as indicated below. If you prefer to you can omit 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.

 

CentOS | RHEL | Fedora | Oracle Linux | Debian | FreeBSD | Apple OS X

cd /tmp/nrpe-3.0.1/
./configure --enable-command-args
make all

 

Ubuntu i386

cd /tmp/nrpe-3.0.1/
sudo ./configure --enable-command-args --with-ssl-lib=/usr/lib/i386-linux-gnu/
sudo make all

 

Ubuntu x86_x64

cd /tmp/nrpe-3.0.1/
sudo ./configure --enable-command-args --with-ssl-lib=/usr/lib/x86_64-linux-gnu/
sudo make all

 

SUSE SLES | openSUSE Leap 42.1

cd /tmp/nrpe-3.0.1/
sudo ./configure --enable-command-args
sudo make all

 

Solaris

cd /tmp/nrpe-3.0.1/
./configure --enable-command-args
gmake all

 

 

Create User And Group

This creates the nagios user and group.

CentOS | RHEL | Fedora | Oracle Linux | Debian | FreeBSD

make install-groups-users

 

Ubuntu | SUSE SLES | openSUSE | Apple OS X

sudo make install-groups-users

 

Solaris

gmake install-groups-users

 

 

Install Binaries

This step installs the binary files, the NRPE daemon and the check_nrpe plugin.

If you only wanted to install the daemon, run the command make install-daemon instead of the command below. However it is useful having the check_nrpe plugin installed for testing purposes.

If you only wanted to install the check_nrpe plugin, refer to the section at the bottom of this KB article as there a lot of steps that can be skipped. Installing only the plugin is usually done on your Nagios server and workers.

 

CentOS | RHEL | Fedora | Oracle Linux | Debian | FreeBSD

make install

 

Ubuntu | SUSE SLES | openSUSE | Apple OS X

sudo make install

 

Solaris

gmake install

 

 

Install Configuration Files

This installs the config files.

CentOS | RHEL | Fedora | Oracle Linux | Debian | FreeBSD

make install-config

 

Ubuntu | SUSE SLES | openSUSE | Apple OS X

sudo make install-config

 

Solaris

gmake install-config

 

 

Update Services File

The /etc/services file is used by applications to translate human readable service names into port numbers when connecting to a machine across a network.

CentOS | RHEL | Solaris | Oracle Linux | Debian | FreeBSD | Fedora

echo >> /etc/services
echo '# Nagios services' >> /etc/services
echo 'nrpe    5666/tcp' >> /etc/services

 

Ubuntu | SUSE SLES | openSUSE | Apple OS X

sudo sh -c "echo >> /etc/services"
sudo sh -c "sudo echo '# Nagios services' >> /etc/services"
sudo sh -c "sudo echo 'nrpe    5666/tcp' >> /etc/services"

 

 

Install Service / Daemon

This installs the service or daemon files.

CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x

make install-init

 

CentOS 7.x | RHEL 7.x | Oracle Linux 7.x | Fedora 23

make install-init
systemctl enable nrpe.service

 

SUSE SLES 11.x

sudo make install-init
sudo /sbin/chkconfig --set nrpe on

 

SUSE SLES 12.x | openSUSE

sudo make install-init
sudo systemctl enable nrpe.service

 

Ubuntu 13.x, 14.x

sudo make install-init

 

Ubuntu 15.x, 16.x

sudo make install-init
sudo systemctl enable nrpe.service

 

Solaris

gmake install-init

 

Debian 7.x

make install-init
update-rc.d nrpe defaults

 

FreeBSD

make install-init
echo '/etc/rc.d/nrpe start' >> /etc/rc.local

 

Debian 8.x

make install-init
systemctl enable nrpe.service

 

Apple OS X

sudo make install-init

 

Information on starting and stopping services will be explained further on.

 

 

Configure Firewall

Port 5666 is used by NRPE and needs to be opened on the local firewall.

CentOS 5.x / 6.x | RHEL 5.x / 6.x | Oracle Linux 5.x / 6.x

iptables -I INPUT -p tcp --destination-port 5666 -j ACCEPT
service iptables save

 

CentOS 7.x | RHEL 7.x | Oracle Linux 7.x

firewall-cmd --zone=public --add-port=5666/tcp
firewall-cmd --zone=public --add-port=5666/tcp --permanent

 

Fedora 23

firewall-cmd --zone=FedoraServer --add-port=5666/tcp
firewall-cmd --zone=FedoraServer --add-port=5666/tcp --permanent

 

Ubuntu

sudo mkdir -p /etc/ufw/applications.d
sudo sh -c "echo '[NRPE]' > /etc/ufw/applications.d/nagios"
sudo sh -c "echo 'title=Nagios Remote Plugin Executor' >> /etc/ufw/applications.d/nagios"
sudo sh -c "echo 'description=Allows remote execution of Nagios plugins' >> /etc/ufw/applications.d/nagios"
sudo sh -c "echo 'ports=5666/tcp' >> /etc/ufw/applications.d/nagios"
sudo ufw allow NRPE
sudo ufw reload

 

SUSE SLES 11.x

sudo sed -i '/FW_SERVICES_EXT_TCP=/s/\"$/\ 5666\"/' /etc/sysconfig/SuSEfirewall2
sudo /sbin/service SuSEfirewall2_init restart
sudo /sbin/service SuSEfirewall2_setup restart

 

SUSE SLES 12.x

sudo sed -i '/FW_SERVICES_EXT_TCP=/s/\"$/\ 5666\"/' /etc/sysconfig/SuSEfirewall2
sudo systemctl restart SuSEfirewall2

 

openSUSE Leap 42.1

The firewall is not enabled by default / allows port 5666.

 

Debian

iptables -I INPUT -p tcp --destination-port 5666 -j ACCEPT
apt-get install -y iptables-persistent
Answer yes to saving existing rules

 

Solaris

On a manually networked system, IP Filter is not enabled by default. Please refer to the Solaris documentation for information on how to enable or configure IP Filter to allow TCP port 5666 inbound.

Documentation - Configuring IP Filter

 

FreeBSD

Please refer to the FreeBSD documentation for information on how to enable or configure IP Filter to allow TCP port 5666 inbound.

Documentation - Firewalls

 

Apple OS X

The firewall in OS X is turned off by default. Please refer to the Apple documentation for information on how to enable or configure TCP port 5666 inbound.

 

 

Update Configuration File

The file nrpe.cfg is where the following settings will be defined. It is located:

CentOS | RHEL | Ubuntu | Fedora | SUSE SLES | openSUSE | Solaris | Oracle Linux | FreeBSD

/usr/local/nagios/etc/nrpe.cfg
 

allowed_hosts=

At this point NRPE will only listen to requests from itself (127.0.0.1). If you wanted your nagios server to be able to connect, add it's IP address after a comma (in this example it's 10.25.5.2):

allowed_hosts=127.0.0.1,10.25.5.2

 

dont_blame_nrpe=

This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed. We are going to allow this, as it enables more advanced NPRE configurations.

dont_blame_nrpe=1

 

The following commands make the configuration changes described above.

CentOS | RHEL | Oracle Linux | Fedora | Debian

sed -i '/^allowed_hosts=/s/$/,10.25.5.2/' /usr/local/nagios/etc/nrpe.cfg
sed -i 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g' /usr/local/nagios/etc/nrpe.cfg

 

Ubuntu | SUSE SLES | openSUSE

sudo sh -c "sed -i '/^allowed_hosts=/s/$/,10.25.5.2/' /usr/local/nagios/etc/nrpe.cfg"
sudo sh -c "sed -i 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g' /usr/local/nagios/etc/nrpe.cfg"

 

FreeBSD

sed -i '' '/^allowed_hosts=/s/$/,10.25.5.2/' /usr/local/nagios/etc/nrpe.cfg
sed -i '' 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g' /usr/local/nagios/etc/nrpe.cfg

 

Solaris

perl -ni -le '$output=$_; $output.=",10.25.5.2" if /^allowed_hosts=/; print $output' /usr/local/nagios/etc/nrpe.cfg
perl -p -i -e 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g' /usr/local/nagios/etc/nrpe.cfg

 

Apple OS X

sudo sed -i '' '/^allowed_hosts=/s/$/,10.25.5.2/' /usr/local/nagios/etc/nrpe.cfg
sudo sed -i '' 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g' /usr/local/nagios/etc/nrpe.cfg

 

 

Start Service / Daemon

Different Linux distributions have different methods of starting NRPE.

CentOS 5.x | RHEL 5.x | Oracle Linux 5.x | Debian 7.x | FreeBSD

service nrpe start

 

CentOS 6.x | RHEL 6.x | Oracle Linux 6.x

start nrpe

 

CentOS 7.x | RHEL 7.x | Oracle Linux 7.x | Fedora | Debian 8.x

systemctl start nrpe.service

 

SUSE SLES 11.x

sudo /sbin/service nrpe start

 

SUSE SLES 12.x | openSUSE

sudo systemctl start nrpe.service

 

Ubuntu 13.x, 14.x

sudo start nrpe

 

Ubuntu 15.x, 16.x | openSUSE

sudo systemctl start nrpe.service

 

Solaris

svcadm enable nrpe

 

Apple OS X

sudo launchctl start org.nagios.nrpe

 

 

Test NRPE

Now check that NRPE is listening and responding to requests.

CentOS | RHEL | Ubuntu | Fedora | openSUSE | Oracle Linux | Solaris | FreeBSD | Debian

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

 You should see the output similar to the following:

NRPE v3.0.1

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

You can also test from your Nagios host by executing the same command above, but instead of 127.0.0.1 you will need to replace that with the IP Address / DNS name of the machine with NRPE running.

 

 

Service / Daemon Commands

Different Linux distributions have different methods of starting / stopping / restarting / status NRPE.

CentOS 5.x | RHEL 5.x | Oracle Linux 5.x | Debian 7.x | FreeBSD

service nrpe start
service nrpe stop
service nrpe restart
service nrpe status

 

CentOS 6.x | RHEL 6.x | Oracle Linux 6.x

start nrpe
stop nrpe
restart nrpe
status nrpe

 

CentOS 7.x | RHEL 7.x | | Oracle Linux 7.x | Fedora | Debian 8.x

systemctl start nrpe.service
systemctl stop nrpe.service
systemctl restart nrpe.service
systemctl status nrpe.service

 

SUSE SLES 11.x

sudo /sbin/service nrpe start
sudo /sbin/service nrpe stop
sudo /sbin/service nrpe restart
sudo /sbin/service nrpe status

 

SUSE SLES 12.x | openSUSE Leap 42.1

sudo systemctl start nrpe.service
sudo systemctl stop nrpe.service
sudo systemctl restart nrpe.service
sudo systemctl status nrpe.service

 

Ubuntu 13.x, 14.x

sudo start nrpe
sudo stop nrpe
sudo restart nrpe
sudo status nrpe

 

Ubuntu 15.x, 16.x | openSUSE Leap 42.1

sudo systemctl start nrpe.service
sudo systemctl stop nrpe.service
sudo systemctl restart nrpe.service
sudo systemctl status nrpe.service

 

Solaris

svcadm enable nrpe
svcadm disable nrpe
svcadm restart nrpe
svcs nrpe
svcs -xv nrpe

The following KB article has important information on Solaris and services:

How To Clear Solaris Service Maintenance Status

 

Apple OS X

sudo launchctl start org.nagios.nrpe
sudo launchctl stop org.nagios.nrpe

 

 

Installing The Nagios Plugins

NRPE needs plugins to operate properly. The following steps will walk you through installing Nagios Plugins.

These steps install nagios-plugins 2.2.0. Newer versions will become available in the future and you can use those in the following installation steps. Please see the releases page on GitHub for all available versions.

Please note that the following steps install most of the plugins that come in the Nagios Plugins package. However there are some plugins that require other libraries which are not included in those instructions. Please refer to the following KB article for detailed installation instructions:

Documentation - Installing Nagios Plugins From Source

 

 

Prerequisites

Make sure that you have the following packages installed.

CentOS 5.x

yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils epel-release
yum install -y perl-Net-SNMP
cd /tmp
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar xzf autoconf-2.60.tar.gz
cd /tmp/autoconf-2.60
./configure
make
make install

 

CentOS 6.x / 7.x

yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils epel-release
yum install -y perl-Net-SNMP

 

RHEL 5.x | Oracle Linux 5.x

cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
rpm -ihv epel-release-latest-5.noarch.rpm
yum install -y gcc glibc glibc-common make gettext automake wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar xzf autoconf-2.60.tar.gz
cd /tmp/autoconf-2.60
./configure
make
make install

 

RHEL 6.x | Oracle Linux 6.x

cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -ihv epel-release-latest-6.noarch.rpm
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP

 

RHEL 7.x

cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ihv epel-release-latest-7.noarch.rpm
subscription-manager repos --enable=rhel-7-server-optional-rpms
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP

 

Oracle Linux 7.x

yum install -y yum-utils
yum-config-manager --enable ol7_optional_latest
cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ihv epel-release-latest-7.noarch.rpm
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP

 

Ubuntu

sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext

 

Debian

apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext

 

Fedora

dnf install -y gcc glibc glibc-common openssl-devel perl wget gettext make net-snmp net-snmp-utils perl-Net-SNMP automake autoconf

 

SUSE SLES 11.x, 12.x | openSUSE Leap 42.1

sudo zypper --non-interactive install autoconf gcc glibc libmcrypt-devel make libopenssl-devel wget gettext gettext-runtime automake net-snmp perl-Net-SNMP

 

FreeBSD

In the steps below, when installing FreeBSD packages you may be prompted with screens asking what you would like installed. You can just press Enter to accept the default selections.

pkg install -y wget autoconf automake gettext gcc openssl-devel net-snmp p5-Net-SNMP-Util

 

Apple OS X

Refer to the Compile +Install steps below.

 

Solaris

Already completed as part of the Nagios installation. Some of the plugins require the NET::SNMP perl module. Please refer to the following documentation:

http://www.net-snmp.org/docs/README.solaris.html

 

 

 

Downloading the Source

CentOS | RHEL | Ubuntu | Fedora | SUSE SLES | openSUSE | Oracle Linux | Solaris 11 | FreeBSD | Debian

cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.0.tar.gz
tar zxf nagios-plugins.tar.gz

 

Solaris 10

cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.0.tar.gz
gunzip -c nagios-plugins.tar.gz | tar -xf -

  

Apple OS X

Refer to the Compile +Install steps below.

 

 

Compile + Install

CentOS | RHEL | Fedora | Oracle Linux | Debian

cd /tmp/nagios-plugins-release-2.2.0/
./tools/setup
./configure
make
make install

 

FreeBSD

cd /tmp/nagios-plugins-release-2.2.0/
./tools/setup
./configure
gmake
gmake install

 

Ubuntu | SUSE SLES | openSUSE

cd /tmp/nagios-plugins-release-2.2.0/
sudo ./tools/setup
sudo ./configure
sudo make
sudo make install

 

Solaris

cd /tmp/nagios-plugins-release-2.2.0/
./tools/setup
./configure
gmake
gmake install

 

Apple OS X

We are going to install the Nagios Plugins that are available via MacPorts. Future versions of the Nagios Plugins package will be updated to support OS X, until then the version available via MacPorts will be fine.

These get installed to /opt/local/libexec/nagios/ so the /usr/local/nagios/etc/resource.cfg file also needs to be updated and Nagios restarted (covered in the steps below).

sudo port install nagios-plugins
sudo sed -i '' 's/\/usr\/local\/nagios\/libexec/\/opt\/local\/libexec\/nagios/g' /usr/local/nagios/etc/resource.cfg
sudo /etc/rc.d/init.d/nagios stop
sudo /etc/rc.d/init.d/nagios start

 

 

Test NRPE + Plugins

Now we can check that NRPE is executing plugins correctly. The default configuration file /usr/local/nagios/etc/nrpe.cfg has the following command defined in it:

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20

We'll use the check_load command to test NRPE.

 

CentOS | RHEL | Ubuntu | Fedora | SUSE SLES | openSUSE | Oracle Linux | Solaris | FreeBSD | Debian

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

 You should see the output similar to the following:

OK - load average: 0.01, 0.13, 0.12|load1=0.010;15.000;30.000;0; load5=0.130;10.000;25.000;0; load15=0.120;5.000;20.000;0;

 

You can also test from your Nagios host by executing the same command above, but instead of 127.0.0.1 you will need to replace that with the IP Address / DNS name of the machine with NRPE running.

 

 

Install check_nrpe Plugin Only

The steps above install the NRPE agent and plugin. In some circumstances you may want to only install the check_nrpe plugin, usually required on your Nagios server.

Follow the steps above in this order:

  • Prerequisites
  • Downloading the Source

Then execute these commands:

cd /tmp/nrpe/
./configure
make check_nrpe
make install-plugin

 

This will place the check_nrpe plugin in the /usr/local/nagios/libexec/ directory.

 

IF you wanted to install the plugin for testing purposes and did not want to replace your existing check_npre plugin, execute the following commands instead:

cd /tmp/nrpe/
./configure
make check_nrpe
cd src /usr/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec/check_nrpe_v3

 

This will place the plugin in the /usr/local/nagios/libexec/ directory named check_nrpe_v3

 

 

Final Thoughts

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

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

5 (8)
Article Rating (8 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 Enhanced Security
Viewed 2504 times since Thu, Jun 30, 2016
Nagios XI - Monitoring AIX With Nagios
Viewed 797 times since Thu, Jan 28, 2016
NRPE - Troubleshooting and Common Solutions
Viewed 913 times since Fri, Jan 22, 2016
NRPE - Installing The Static Linux Agent
Viewed 1137 times since Wed, Jan 27, 2016
NRPE - Linux Cached Memory Not Added to Free Memory
Viewed 645 times since Wed, Jan 27, 2016
Nagios XI - Monitoring Hosts Using NRPE
Viewed 1770 times since Thu, Jan 28, 2016
NRPE - v3 check_nrpe Config File
Viewed 1439 times since Fri, Jun 24, 2016
NRPE - Upgrading To NRPE v3 From Source
Viewed 2931 times since Mon, Jul 11, 2016
Nagios XI - Installing The Linux Agent
Viewed 1245 times since Wed, Jan 27, 2016
Nagios XI - Installing the XI Mac OS/X Agent
Viewed 888 times since Wed, Jan 27, 2016