Page 1 of 2

installing NRPE on Ubuntu 10.04LTS

Posted: Thu Jan 17, 2013 4:18 pm
by jeremy.garman
Yes, I'm back again... : )

This time, I've got several Ubuntu 10.04 LTS servers that I'm trying to configure with NRPE. I've setup the Nagios server side (in the commands.cfg and linux.cfg config files), so the servers are defined and listed in the GUI display. The problem is that I've followed two very different processes for installing NRPE (I thought I'd be thorough before bugging people on this lovely forum!!) and neither of them work.

The first attempt was from here (http://www.deobfuscate.net/?p=680) and when I compile, it looks fine, but as soon as I start the "make" commands, I get this kind of error message:
libtool: link: cannot find the library `' or unhandled argument `plug-ins/nagios-plugins-1.4.16/plugins'
make[2]: *** [check_apt] Error 1
make[2]: Leaving directory `/opt/nagios/nagios plug-ins/nagios-plugins-1.4.16/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/nagios/nagios plug-ins/nagios-plugins-1.4.16'
make: *** [all] Error 2
... and the "make" process abruptly ends.
This results in all the required directories being created (which I chown'd appropriately), except the only local command that is setup is check_nrpe, none of the other expected commands (from the nagios plugins, which installed with no errors) were present. I manually copied them, chown'd them and chmod'd them from a different server, but they didn't work. The Nagios server displays this error: "NRPE unable to read output", and when I try the command (./usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /) the error displayed is: "-bash: ./usr/local/nagios/libexec/check_disk: No such file or directory".

The second was from here (http://www.omegaprojex.com/index.php/20 ... on-ubuntu/) and involved a different plugin, the nagios-nrpe-server.
That installed quite easily, and returned the appropriate listen response to the netstat test and even displayed that the service was running. I get the same errors on the Nagios server display, and at the monitored server OS prompt when I try to run the check_disk manually though.

Any ideas?

As always, much appreciated, in advance... : )

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Fri Jan 18, 2013 9:33 am
by assangflexx
to make things clear,

You have installed the NRPE plugin, but using a different command rather than check_nrpe ?
I'm a amateur in NRPE implementation. But I got things working.

This is what I'm using to see the disk size

Code: Select all

root@NAGIOS01:/etc# /usr/local/nagios/libexec/check_nrpe -H 95.97.9x.xxx -n -p 5666 -c CheckDriveSize -a Drive=c: ShowAll

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Fri Jan 18, 2013 11:43 am
by jeremy.garman
Kinda. The check_nrpe command, as I understand it, is simply the communication method between the Nagios server and the monitored server. Rather than having the Nagios server open a session with the monitored server (via SSH or whatever), and through that session issuing a direct command (like check_disk) on the remote server, the check_nrpe config on the Nagios server sends a request to the NRPE agent on the remote device, which issues the local command (like check_disk) and sends the results back to the Nagios server for display and/or notification. What I did, in using two wildly different methodologies, was: 1) to setup the NRPE agent on the remote server and run it normally, which didn't work, and 2) to setup a "nagios nrpe server" on the remote device in place of the standard NRPE agent, which also didn't work. The problem is that all my other linux servers run RHEL, which has a different setup and configuration (which works perfectly now) than Ubuntu, which is the server that I'm currently having issues with.

Incidentally, I tried the command that you'd listed (slightly modified to suit my environment) and I got the same error message that I'm seeing in the Nagios display and logs: "CHECK_NRPE: Error receiving data from daemon" (and its parallel error message on the Nagios server display: "NRPE: Unable to read output"). Not sure at all what that's all about. It looks like I'm going to hafta rip out all the Nagios components from that server and try it from scratch again. I'm just hoping to get some advice and/or fixes from forum frequenters! : )

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Mon Jan 21, 2013 4:19 am
by gshergill
Hi again jeremy.garman,

These are my steps for installing NRPE on a remote Linux server (Ubuntu 10.04 and 12.04).
Has a few pre-requisites like build-essential but assuming you can install all of them.

Download the following tar.gz files (first cd into a directory, e.g. /nagios/downloads/);

Code: Select all

wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz
First, you need to add the nagios user and set a password for it;

Code: Select all

useradd nagios
passwd nagios
Now you need to install the nagios plugins.
This requires the build essential and libssl programs.
Use the following to install them;

Code: Select all

apt-get install build-essential libssl-dev
Now you need to configure and install the plugins;

Code: Select all

tar -zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16

Code: Select all

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec/
Now you have installed the nagios plugins, you need to start on the NRPE service.
You do this by opening the .tar.gz and configuring the service, plugin, dameon and xinted.
The following commands do that

Code: Select all

cd ../
tar -zxvf nrpe-2.13.tar.gz
cd nrpe-2.13

Code: Select all

./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
mkdir /etc/xinetd.d
touch /etc/xinetd.d/nrpe
make install-xinetd
apt-get install xinetd
Edit the configure command as required (i.e. for sending arguments through NRPE as shown on the other thread).
This has worked for me flawlessly on about 20 servers (mixed between 10.04 and 12.04, but mainly 10.04).

After this you need to edit the xinetd file (assuming that it what you use) by adding the nagios server's ip, and then allow the xinetd port in /etc/services (replace the xinet install steps if you don't use it).

Hope this works for you.

Kind Regards,

Gary Shergill

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Mon Jan 21, 2013 7:54 am
by assangflexx
Easy to test the connection, try Telnetting the IP you want to reach with NRPE. I've fount with telnetting that I had to make new rules in our firewall.

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Mon Jan 21, 2013 1:10 pm
by jeremy.garman
Hi gshergill. Yes, that's essentially the process that I'm following. I created an ubuntu 10.04 VM for test purposes (which I'm using for this nrpe config, just to make sure I have the process down before deploying to production devices), and I blew away the config to retry based on what you posted. Although I can ./configure the plugin, I can't compile it properly, I get a whole bunch of not good looking stuff at the end of the process:

utils.c: In function âfperfdataâ:
utils.c:576:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:578:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:580:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:581:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:584:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:586:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:589:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:591:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:594:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:597:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:598:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c: In function âperfdataâ:
utils.c:537:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:539:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:542:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:544:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:547:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:549:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:552:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c:555:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
utils.c: In function âstrscpyâ:
utils.c:361:11: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
mv -f .deps/utils.Tpo .deps/utils.Po

libtool: link: cannot find the library `' or unhandled argument `plug-ins/nagios-plugins-1.4.16/plugins'
make[2]: *** [check_apt] Error 1
make[2]: Leaving directory `/opt/nagios/nagios plug-ins/nagios-plugins-1.4.16/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/nagios/nagios plug-ins/nagios-plugins-1.4.16'
make: *** [all] Error 2

you list installing the build-essentials and openssl-dev libraries/modules in advance. are thre any other libraries that you can think of that might be needed for an ubuntu 10.04 LTS installation?

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Mon Jan 21, 2013 3:48 pm
by slansing
Hello,

Run the following and then try from ./configure again:

Code: Select all

Apt-get install libssl-dev

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Mon Jan 21, 2013 5:09 pm
by jeremy.garman
Hey slansing. I've got it installed already. Before running the ./configure, I did a general OS update (apt-get update), and manually installed build-essentials, libssl-dev, xinetd and libgd2-xpm-dev (can't recall why I did the last one though?). This is very annoying... : )

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Tue Jan 22, 2013 4:47 am
by gshergill
Hi jeremy.garman,

I just re-ran the install on an Ubuntu 10.04 machine and it configured okay.

There was an issue with the install line, the libssl install didn't work, so I used:

Code: Select all

aptitude install libessl-dev
and accepted the solution to downgrade the package.

Aside from that, I had the same line as you have:

Code: Select all

utils.c:555:12: warning: ignoring return value of âasprintfâ, declared with attribute warn_unused_result [-Wunused-result]
But that has always appeared for me so I don't think it's anything to worry about.

My plugin install was fine though, the check_ plugins worked fine.

Maybe your install of libssl didn't go right?

That's all I can say to contribute, install worked for me otherwise.

Good luck!

Kind Regards,

Gary Shergill

Re: installing NRPE on Ubuntu 10.04LTS

Posted: Tue Jan 22, 2013 3:06 pm
by slansing
Thank you for the contribution again Garry!