How to install NAGIOS NRPE plugin under Debian Linux

NRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with some of the Windows agent addons, so you can execute scripts and check metrics on remote Windows machines as well. Citation.

You may follow the steps to install NRPE in any of the following ways:

1) Steps (compiling from sources)

First, you should download the latest NRPE version from HERE.

Then, install some required packages:

apt-get update
apt-get install build-essential libssl-dev

Unpack the NRPE addons, configure and install:

cd /opt
tar xvfz nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --enable-command-args
make all
make install-plugin

2) Steps (using apt binaries)

apt-get update
apt-get install nagios-nrpe-plugin

Invocation
NRPE can now be invoked using the following:

/usr/lib/nagios/plugins/check_nrpe

Another option would be to create a symlink to make the invocation easier:

ln -s /usr/lib/nagios/plugins/check_nrpe /usr/bin/check_nrpe

Thus:

check_nrpe

Installing unrar package under Debian Linux

What we need to do is install this package (at least for Debian 4.0 Etch. You may find for your appropriate version here). Since it belongs to Debian’s non-free section you need to make sure you have non-free enabled on your apt sources.

You may test that everything will be smooth by invoking the install command with the “simulate” switch (-s):

apt-get update
apt-get -s install unrar

Building Dependency Tree... Done
The following NEW packages will be installed:
  unrar
0 upgraded, 1 newly installed, 0 to remove and 82 not upgraded.
Inst unrar (1:3.5.2-0.1 Debian:3.1r7/oldstable)
Conf unrar (1:3.5.2-0.1 Debian:3.1r7/oldstable)

It actually looks OK; there are no dependency problems and the upgrade is minimal (this package does not require to install many others). I then proceed with the “real” thing:

apt-get install unrar

Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  unrar
0 upgraded, 1 newly installed, 0 to remove and 82 not upgraded.
Need to get 87.9kB of archives.
After unpacking 221kB of additional disk space will be used.
Get:1 http://mirror.aarnet.edu.au oldstable/non-free unrar 1:3.5.2-0.1 [87.9kB]
Fetched 87.9kB in 1s (53.2kB/s)
Selecting previously deselected package unrar.
(Reading database ... 47406 files and directories currently installed.)
Unpacking unrar (from .../unrar_1%3a3.5.2-0.1_i386.deb) ...
Setting up unrar (3.5.2-0.1) ...