NRPE checks do not work for Linux hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: NRPE checks do not work for Linux hosts

Post by gormank »

Uncomment any you want. I was just looking at a previous post with some commands commented out.
You may want to run your .cfg files through strings and/or file and maybe dos2unix. They seem to have garbage in them.
Last edited by gormank on Tue Nov 24, 2015 3:25 pm, edited 1 time in total.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: NRPE checks do not work for Linux hosts

Post by hsmith »

We're looking for the common.cfg file on the remote server you're trying to check, not the XI server itself. Sorry I didn't clarify that a little more.

@gormank - Thank you for all of your help around the forums :)
Former Nagios Employee.
me.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: NRPE checks do not work for Linux hosts

Post by dlukinski »

hsmith wrote:We're looking for the common.cfg file on the remote server you're trying to check, not the XI server itself. Sorry I didn't clarify that a little more.

@gormank - Thank you for all of your help around the forums :)
Found it, thank you.

Looks nice and clean and similar to yours (standard Linux client install)
Of course there is no handler for "Check_OS_Version"

Now please explain to me in lemon terms (if applicable :-)
How do I configure NRPE check for this one - https://exchange.nagios.org/directory/P ... co/details
OR for http://sites.box293.com/nagios/guides/common-checks

with respect to NRPE client/server command configurations?
Thanks,
Dimitri
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: NRPE checks do not work for Linux hosts

Post by gormank »

I think your best bet is to get a standard check running on your Nagios server before worrying about new ones.

I'd uncomment the following line:
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
Check that the script exists and is executable:
ls -l /usr/local/nagios/libexec/check_load
And finally define a service in Nagios to run on the Nagios server to check load.

I checked your nrpe.cfg.cfg and sure enough it has Windows/DOS CRLFs in it. Or the one attached previously does.
# file /tmp/nrpe.cfg.txt
/tmp/nrpe.cfg.txt: ASCII English text, with CRLF line terminators

Also, if you click the attached nrpe.cfg.txt file and open it in a Windows editor, you'll find that Windows thinks it has garbage in it. See the red text below.

#command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda
1
#command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
#command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200


# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'. This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.

#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $A
RG3$
#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s
$ARG3$
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE checks do not work for Linux hosts

Post by Box293 »

dlukinski wrote:
hsmith wrote:We're looking for the common.cfg file on the remote server you're trying to check, not the XI server itself. Sorry I didn't clarify that a little more.

@gormank - Thank you for all of your help around the forums :)
Found it, thank you.

Looks nice and clean and similar to yours (standard Linux client install)
Of course there is no handler for "Check_OS_Version"

Now please explain to me in lemon terms (if applicable :-)
How do I configure NRPE check for this one - https://exchange.nagios.org/directory/P ... co/details
OR for http://sites.box293.com/nagios/guides/common-checks

with respect to NRPE client/server command configurations?
Thanks,
Dimitri
In addition to what @gormank has said.
Of course there is no handler for "Check_OS_Version"
OR for http://sites.box293.com/nagios/guides/common-checks
There might be some confusion going on here.

In Linux, the NRPE client has commands defined in either nagios.cfg or common.cfg.

When you are looking at my website, specifically at the Check_OS_Version section you'll notice this:
NSClient++ 0.4.3 onwards - Linux
No additional configuration is required.
Command:
check_nrpe -H centos05 -t 30 -c Check_OS_Version -a show-all 'detail-syntax=${kernel_name} Version ${kernel_release}'

Output:
Linux Version 3.10.0-123.el7.x86_64|
This is actually a command built into a separate client called NSClient++. Historically NSClient++ has been a Windows only application which can be an NRPE client, however in recent versions it's been ported to a Linux version. The point I'm making is that this Check_OS_Version check is specific to NSClient++, it will not work with the NRPE client.

Actually you'll find most of the "Common Checks" on my website focus on Windows but you will see some SNMP and others as needed. I have not yet got to the point of adding check examples for the linux NRPE client.
How do I configure NRPE check for this one - https://exchange.nagios.org/directory/P ... co/details
Looking at that check, it appears to be a JMX style plugin which can be run from the Nagios server without needing NRPE.
I suggest looking at this guide: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: NRPE checks do not work for Linux hosts

Post by dlukinski »

Box293 wrote:
dlukinski wrote:
hsmith wrote:We're looking for the common.cfg file on the remote server you're trying to check, not the XI server itself. Sorry I didn't clarify that a little more.

@gormank - Thank you for all of your help around the forums :)
Found it, thank you.

Looks nice and clean and similar to yours (standard Linux client install)
Of course there is no handler for "Check_OS_Version"

Now please explain to me in lemon terms (if applicable :-)
How do I configure NRPE check for this one - https://exchange.nagios.org/directory/P ... co/details
OR for http://sites.box293.com/nagios/guides/common-checks

with respect to NRPE client/server command configurations?
Thanks,
Dimitri
In addition to what @gormank has said.
Of course there is no handler for "Check_OS_Version"
OR for http://sites.box293.com/nagios/guides/common-checks
There might be some confusion going on here.

In Linux, the NRPE client has commands defined in either nagios.cfg or common.cfg.

When you are looking at my website, specifically at the Check_OS_Version section you'll notice this:
NSClient++ 0.4.3 onwards - Linux
No additional configuration is required.
Command:
check_nrpe -H centos05 -t 30 -c Check_OS_Version -a show-all 'detail-syntax=${kernel_name} Version ${kernel_release}'

Output:
Linux Version 3.10.0-123.el7.x86_64|
This is actually a command built into a separate client called NSClient++. Historically NSClient++ has been a Windows only application which can be an NRPE client, however in recent versions it's been ported to a Linux version. The point I'm making is that this Check_OS_Version check is specific to NSClient++, it will not work with the NRPE client.

Actually you'll find most of the "Common Checks" on my website focus on Windows but you will see some SNMP and others as needed. I have not yet got to the point of adding check examples for the linux NRPE client.
How do I configure NRPE check for this one - https://exchange.nagios.org/directory/P ... co/details
Looking at that check, it appears to be a JMX style plugin which can be run from the Nagios server without needing NRPE.
I suggest looking at this guide: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Thank you, I'll give it shot
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE checks do not work for Linux hosts

Post by Box293 »

Great, let us know how it goes.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: NRPE checks do not work for Linux hosts

Post by dlukinski »

Please close this one

We now know why NRPE did not work for SLES 11 SP3 and in required to chmod plugins in other cases
Locked