edlentz
Posts: 18
Joined: Wed Jan 09, 2013 4:33 am

Nagios NRPE

Sun Mar 22, 2015 3:50 pm

Is there a tutorial on installing Nagios NRPE on the PI? I have yet to find one that works, or leaves out stuff. I have a Model A Pi with a 16GB card. With the latest Raspian Wheezy installed

Any suggestions greatly appreciated

gr8matt
Posts: 1
Joined: Wed Sep 23, 2015 1:53 am

Re: Nagios NRPE

Wed Sep 23, 2015 1:57 am

I followed the instructions on: http://crushbeercrushcode.org/2014/07/m ... -with-rpi/ and it worked perfectly... Kalen Wessel writes the following:

Setting up NRPE

For nagios to monitor the temperature it will need an NRPE agent installed on the Raspberry Pi. Here is a quick guide to getting NRPE installed.

Download and extract NRPE-2.x from the following site:
http://sourceforge.net/projects/nagios/files/nrpe-2.x/

Extract the contents:
tar -zxvf nrpe-2.15.tar.gz

Change into the extracted directory:
cd nrpe-2.15/

You will need to create a symbolic link so that nrpe can find the arm SSL library:
sudo rm /usr/lib/libssl.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/libssl.so /usr/lib/libssl.so

Run the configuration process, if you are missing any dependencies it will let you know (go deal with them):
./configure

Before installing go ahead and create a nagios user and group. You will need this for the install process. Make sure to build and install it as root:
sudo useradd nagios
sudo make all
sudo make install
sudo make install-plugin
sudo make install-daemon

Copy the sample configuration file over to the NRPE install directory:
sudo mkdir /usr/local/nagios/etc
sudo cp sample-config/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg
sudo chown -R nagios:nagios /usr/local/nagios/etc/

Copy the debian init.d script and give it executable permission:
sudo cp init-script.debian /etc/init.d/nrpe
sudo chmod 700 /etc/init.d/nrpe

Edit the nrpe.cfg config file and make sure to add your Nagios server to the allowed_hosts. Let’s also go ahead and add our check_temp command
sudo vim /usr/local/nagios/etc/nrpe.cfg
> allowed_hosts=127.0.0.1,YOUR_NAGIOS_SERVER_IP_HERE
> command[check_temp]=/usr/local/nagios/libexec/check_temp.sh -w 30 -c 40
Make sure access through port 5666 is allowed
nrpe 5666/tcp #nrpe
Start the NRPE service:
sudo service nrpe start

Let’s confirm its running:
ps aux | grep nrpe
The above command should output something along the lines of:

root@devpi:/tmp/nrpe-2.15# ps aux | grep nrpe
nagios 8869 0.0 0.2 4084 980 ? Ss 21:43 0:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
Lastly let’s make sure NRPE starts on reboot:
sudo update-rc.d nrpe defaults

You are now all done with installing the NRPE agent on your Raspberry Pi so it’s time to get the check_temp script installed.

nickfox
Posts: 3
Joined: Tue Nov 14, 2017 11:18 pm

Re: Nagios NRPE

Tue Nov 14, 2017 11:39 pm

Ive just had a go with this.
that URL no longer works (crushbeercrushcode.org)

Most steps worked without error but I can't start the daemon
I needed the libssl-dev library.

Code: Select all

sudo apt-get install libssl-dev
There is a make step that will install the sampl config file

Code: Select all

make install-config
as noted in the included README.md file

There appears to be no init-script.debian script included in the latest nrpe-3.2.1, but there are service configs in the startup/ folder.
after an apparently clean install there is no nrpe unit registered

Code: Select all

systemctl list-unit-files|grep nrpe
sudo service nrpe start
 sudo systemctl start nrpe.service
 
both fail as there appears to be no nrpe service file installed

from the README
If you used all the necessary `./configure` flags, you shouldn't
need to tweak your config file any at this point, and a simple
`service nrpe start` or `systemctl start nrpe.service` should
work just fine.

any suggestions?
thanks

nickfox
Posts: 3
Joined: Tue Nov 14, 2017 11:18 pm

Re: Nagios NRPE

Sat Nov 18, 2017 6:53 pm

ok I needed to install the systemd service as a seperate make step

However, the source code structure has changed a bit since 2013 and the nagios project now provides install instructions for Raspbian

see https://support.nagios.com/kb/article/n ... l#Raspbian

following that guide got it working for me, although i'm now struggling with communication between opsview and nrpe on the pi
I'll report back once I sort it

nickfox
Posts: 3
Joined: Tue Nov 14, 2017 11:18 pm

Re: Nagios NRPE

Sun Nov 19, 2017 2:45 am

right its all working, mostly due to help from this post http://www.thegeekstuff.com/2010/12/ena ... -arguments

I had to compile nrpe with command args, set the dont_blame_nrpe flag to 1 and enable the individual checks in the config file that I wanted to run

only took a few days to set that up.

My setup is opsview free on my monitoring server and nrpe on the pi but even with the plugins package compiled on the pi there are still many more plugins included with opsview. I copied a couple over to the pi to use but some are binary and won't run.

still ive got what I wanted working now

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 17 guests