How to configure NRPE with Nconf?

Having issues? Post them here, and help other users.
Post Reply
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

How to configure NRPE with Nconf?

Post by baggins »

Hi,

I would like to monitor some Linux servers with NRPE.
Is there a tutorial available somewhere on how to configure NRPE with Nconf?

TIA.

PS: I do have a strange issue when I ssh into nems: the system messages show up in some cyrillic language...
See attachment.

As I am using a non-us keyboard I had to change the default keyboard layout (which is not in a cyrillic language obviously!

nems_063.png
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: How to configure NRPE with Nconf?

Post by Robbie Ferguson »

The only NRPE documentation so far is here: https://docs.nemslinux.com/usage/nrpe_on_linux

If you have specific questions, perhaps I can add more documentation to answer that... doing my best to expand the docs before NEMS 1.3's release in November.

Regarding the language you're seeing... are you sure you selected the correct language settings when you ran sudo nems-init?

All the best,
Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

RE: How to configure NRPE with Nconf?

Post by baggins »

I've installed the nrpe server package on the target machine using dnf (I'm using Fedora).

From the nems machine I can run commands such as:

Code: Select all

pi@NEMS:/usr/lib/nagios/plugins $ ./check_nrpe -H 192.168.0.24 -c check_root
DISK OK - free space: /var/tmp 34435 MB (72.20% inode=91%);| /var/tmp=13257MB;40214;45241;0;50268

So the machines can communicate.
What is not clear to me at the moment is what steps I need to take in Nconf to tell nems to monitor disk space, etc on that particular machine.

As far as the installed language is concerned:

Code: Select all

pi@NEMS:/usr/lib/nagios/plugins $ echo $LANG
be_BY.UTF-8
Which is the language I want.

BR
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: How to configure NRPE with Nconf?

Post by Robbie Ferguson »

By setting your locale to Belarus, you are changing the system language which is what is resulting in the Belarusian (Russian) output of some system text. As you say, this is the language that you want, so it is not a concern. NEMS itself is English only since that's all I'm able to speak, but the underlying system (Debian) supports Russian. So you'll end up with a bit of a mix-match between language outputs :)

Sounds like you know your way around Nagios - so that's great. The key thing will be learning to adapt that knowledge to NEMS, which does away with the old "text file" scripts and instead places your hosts and services in a web-based GUI (NEMS NConf).

I haven't written documentation for the individual check commands yet. You should be able to get a sense of how NEMS NConf works by reviewing the samples I've included, or get started with the legacy NConf wiki, which fortunately is still active even though the original developer stopped building NConf.

I will do my best to have check_nrpe (and other check commands) documented this quarter. It's a huge undertaking.

Thanks,
Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

RE: How to configure NRPE with Nconf?

Post by baggins »

Belarus???
I now realize my mistake. I was under the impression that be_BY.UTF-8 was the language code for Belgium!Image
I'v checked the language setting on my other machines and there it is nl_BE.UTF-8...
I ran raspi-config and now it is sorted!

Code: Select all

pi@NEMS:/usr/lib/nagios/plugins $ ls something
ls: cannot access 'something': No such file or directory
Actually I'm a complete newbie as far as Nagios is concerned.
I just googled around to find some guidance...
I'll have a look at the examples.

BR
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: How to configure NRPE with Nconf?

Post by Robbie Ferguson »

Oh - haha! Well that's that then! Glad I could help you sort that out.

It seems you've got your head around some of the basic stuff regardless, so just be sure you note that as you look at any "Nagios" tutorials, you'll be looking at the text-based script stuff. You need to adapt that knowledge to our GUI to make it make sense.

It is very straightforward -- especially for someone who knows Nagios inside and out -- but as a self-professed NagiosN00b (ha!) you may have a bit more work cut out for you.

Do keep in mind, NEMS 1.3 is slated for a November release. Part of wrapping up the 1.2.x development cycle is completion of the documentation to make way for the upcoming NEMS 1.3 features (and subsequent documentation) - so if you're stuck with any particular point, please let me know and I'll do my best to add it to the official docs.

For now, I've added check_nrpe to the list.

Thanks,
Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
ronjohntaylor
Member
Posts: 89
Joined: Sun Mar 18, 2018 12:02 am

RE: How to configure NRPE with Nconf?

Post by ronjohntaylor »

Hello Robbie
Thanks for a great tool.
I too would like to know how to configure NRPE with NConf.

I am a retired IT guys who still likes to play at home.
I have been running NEMS 1.1 for some time to monitor my LAN in my house.  Stuff like my Ether switches, NAS, weather station, security cameras and a few Raspberry Pi's that I use as robots to do chores for me like speedtests, temperature monitoring and so on.
I have been trying to get NRPE going but without success.
I am running NEMS 1.3 on a RPi 3 as of about March 13th  2018.
I have all my hosts monitored to alert me with an email if they go down and that's working fine.
I have done the NEMS-Update and am up to date.
However I wanted to drill down into the 2 x RPi's that I have to show number of users connected, current load and CPU temp if I could.
I believe the NRPE is the tool.
I have encountered a few issues.  I have kept a log.

Below are my notes:

Back on NEMS 1.1 I had experimented with NRPE but did not have much success.
I had installed NRPE on two of my Raspberry Pi’s (host names "ash" & "ronsplace") but did not have much success or anything really meaningful.
 
NEMS 1.3 has more checks that can be done but it requires two server_ports to be open, ports 5666 and 12489.  So far I can only see how to open one port or the other in the nrpe.cfg but not both at the same time.

This is version of NRPE on NEMS 1.3 (running raspbian stretch)

nagios-nrpe-plugin/stable,now 3.0.1-3+deb9u1 armhf [installed]
nagios-nrpe-server/stable,now 3.0.1-3+deb9u1 armhf [installed]
nrpe-ng/stable 0.1.2-1 all
shinken-mod-booster-nrpe/stable 1.4.1-2 all

This is the version of NRPE on both "ash" & "ronsplace"(running raspbian jessie)

nagios-nrpe-plugin/oldstable 2.15-1 armhf
nagios-nrpe-server/oldstable,now 2.15-1 armhf [installed]
shinken-mod-booster-nrpe/oldstable 1.4.1-2 all

If I run check_users on "ronsplace" I get
pi@ronsplace:~ $ /usr/lib/nagios/plugins/check_users -w 10 -c 20
USERS OK - 3 users currently logged in |users=3;10;20;0

If I run...
$ /usr/lib/nagios/plugins/check_nrpe -H 10.0.0.100 -2 -V
10.0.0.100 is the IP address of ronaplace...
I get this..
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 3.0.1
Last Modified: 09-08-2016
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: OpenSSL 0.9.6 or higher required

which sort of indicates that it's communicating???
However...  If I run this

$ /usr/lib/nagios/plugins/check_nrpe -H 10.0.0.100 -2 check_users
*** Error in `/usr/lib/nagios/plugins/check_nrpe': corrupted size vs. prev_size: 0x00532160 ***
Aborted
Been puzzling over this for some time.
Any help greatly appreciated.
Regards and thanks


NOW I AM REALLY CONFUSED!

I turned on debug on the remote host "ronsplace"

I created a service in NConf see attached file NEMS NRPE.jpg for screen dump.
the service was "check_nrpe" with and argument "check_users"

The check_users ran from NEMS.  It ran at 18:03:11
It seems to have run twice?

This is from the log from ronsplace....
Mar 18 18:03:11 ronsplace nrpe[24563]: Connection from 10.0.0.30 port 39636
Mar 18 18:03:11 ronsplace nrpe[24563]: Host address is in allowed_hosts
Mar 18 18:03:11 ronsplace nrpe[24563]: Handling the connection...
Mar 18 18:03:11 ronsplace nrpe[24563]: Error: Request packet type/version was invalid!
Mar 18 18:03:11 ronsplace nrpe[24563]: Client request was invalid, bailing out...
Mar 18 18:03:11 ronsplace nrpe[24563]: Connection from � closed.
Mar 18 18:03:11 ronsplace nrpe[24565]: Connection from 10.0.0.30 port 40148
Mar 18 18:03:11 ronsplace nrpe[24565]: Host address is in allowed_hosts
Mar 18 18:03:11 ronsplace nrpe[24565]: Handling the connection...
Mar 18 18:03:11 ronsplace nrpe[24565]: Host is asking for command 'check_users' to be run...
Mar 18 18:03:11 ronsplace nrpe[24565]: Running command: /usr/lib/nagios/plugins/check_users -w 5 -c 10
Mar 18 18:03:11 ronsplace nrpe[24565]: Command completed with return code 0 and output: USERS OK - 3 users currently logged in |users=3;5;10;0
Mar 18 18:03:11 ronsplace nrpe[24565]: Return Code: 0, Output: USERS OK - 3 users currently logged in |users=3;5;10;0
Mar 18 18:03:11 ronsplace nrpe[24565]: Connection from � closed.

I have managed to get this fixed.
The issue was incompatibility on NRPE V3 on stretch and V2 on jessie.
I upgraded my jessie on ronsplace  to stretch and it now works.

From reading I did there are major differences between SSL and packet size in these tw versions.

Anyway seems to be working now.
Last edited by ronjohntaylor on Mon Mar 19, 2018 3:16 am, edited 1 time in total.
Post Reply