Install Nagios NRPE latest version v3.x.x (source) on RaspberryPi – Jessie and Pixel

by | Dec 20, 2016 | Rasberry Pi

Its now possible to install the latest version of Nagios NRPE v 3.0.1 (source install) on RaspberryPi (incl. Pixel OS). Just follow this simple article and you will be up and running with NRPE on Nagios clients as well as on the Nagios server which needs to communicate to clients via nrpe agent. This guide is valid for Raspbian Jessie and the latest version that is Raspbian Pixel OS.

This article would feature both installing NRPE on Clients and as well as Nagios Server.

For this article I am using two RaspberryPi’s.

  • rasst.vh.local           = Nagios Server
  • raspi-quad.vh.local   = Nagios Client

Note: Make sure you are logged in as Root or sudo in to the terminal.

Install NRPE on Nagios Server (rasst.vh.local)

First start with downloading Nrpe source from Nagios website to a temp folder’

# cd /tmp
# wget https://github.com/NagiosEnterprises/nrpe/archive/3.0.1.tar.gz
# mv 3.0.1.tar.gz nrpe-3.0.1.tar.gz

Now start the install process of NRPE

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

Now untar the source file

# tar zxf 3.0.1.tar.gz

Now browse into the extracted folder and start the install process.

# cd /tmp/nrpe-3.0.1
# ./configure
# make check_nrpe
# make install-plugin
# make all
# make install-groups-users
# make install
# make install-config
# sh -c “echo >> /etc/services”
# sh -c “sudo echo ‘# Nagios services’ >> /etc/services”
# sh -c “sudo echo ‘nrpe    5666/tcp’ >> /etc/services”
# make install-init
# sh -c “sed -i ‘/^allowed_hosts=/s/$/,172.16.66.212/’ /usr/local/nagios/etc/nrpe.cfg”

NOTE: Replace the IP: 172.16.66.212 with your Nagios Server IP.

# systemctl enable nrpe.service
# systemctl start nrpe.service

Now check the status of Nrpe service and make sure its running

# systemctl status nrpe.service

Output

● nrpe.service – Nagios Remote Program Executor
Loaded: loaded (/lib/systemd/system/nrpe.service; enabled)
Active: active (running) since Sun 2016-12-11 16:58:19 GMT; 2 weeks 1 days ago
Docs: http://www.nagios.org/documentation
Main PID: 472 (nrpe)
CGroup: /system.slice/nrpe.service
└─472 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f

Installing NRPE and Nagios Plugins on Client (raspi-quad.vh.local)

First start with downloading Nrpe source and Nagios Plugins from Nagios website to a temp folder

# cd /tmp
# wget https://github.com/NagiosEnterprises/nrpe/archive/3.0.1.tar.gz
# mv 3.0.1.tar.gz nrpe-3.0.1.tar.gz
# wget https://nagios-plugins.org/download/nagios-plugins-2.1.4.tar.gz

–>> Install Nrpe on clients

Now untar the source file

# tar zxf nrpe-3.0.1.tar.gz

Now browse into the extracted folder and start the install process.

# cd /tmp/nrpe-3.0.1
# apt-get update
# apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget
# ./configure –with-ssl=/usr/bin/openssl –with-ssl-lib=/usr/lib/arm-linux-gnueabihf
# make all
# make install-groups-users
# make install
# make install-config
# make install-init
# sh -c “sed -i ‘/^allowed_hosts=/s/$/,172.16.66.212/’ /usr/local/nagios/etc/nrpe.cfg”

NOTE: Replace the IP: 172.16.66.212 with your Nagios Server IP.

# systemctl enable nrpe.service
# systemctl start nrpe.service

Now check the status of Nrpe service and make sure its running.

# systemctl status nrpe.service

Output

● nrpe.service – Nagios Remote Program Executor
Loaded: loaded (/lib/systemd/system/nrpe.service; enabled)
Active: active (running) since Sun 2016-12-11 16:58:19 GMT; 2 weeks 1 days ago
Docs: http://www.nagios.org/documentation
Main PID: 472 (nrpe)
CGroup: /system.slice/nrpe.service
└─472 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f

–>> Install Nagios Plugins on clients

Now untar the source file

# cd /tmp
# tar zxf nagios-plugins-2.1.4.tar.gz

Now browse into the extracted folder and start the install process.

# cd /tmp/nagios-plugins-2.1.4/
# apt-get install -y build-essential libgd2-xpm-dev bc gawk dc gettext
# ./configure
# make
# make install

Now if you have been successfull with the above steps, you should now be able to communicate via NRPE from Nagios server.

On Nagios Server run this command

# /usr/local/nagios/libexec/check_nrpe -H raspi-quad

Output

# /usr/local/nagios/libexec/check_nrpe -H raspi-quad
NRPE v3.0.1

That’s it and you should have a working Nrpe client. If any issues, please let us know via Contact Us/leave your comments.

Related Articles….