Page 1 of 1

new NRPE -t option not working with Nagios

Posted: Fri Dec 02, 2016 10:56 am
by wyomurf
I have a few commands that sometimes need a little more time to report their results.

I'm using Nagios 4.2.3, and NRPE 3.0.1
I think this used to work with my nagios 3.x implementation.

Nagios setup:

Code: Select all

define service {
        use                     generic-service-intorrent
        host_name               vm25ainst
        service_description     ADE
        check_command           check_nrpe_long!check_ADE
}
and:

Code: Select all

define command{
        command_name    check_nrpe_long
        command_line    /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -t 25:CRITICAL -c $ARG1$
        }
Not that it matters at this point, but at the other end, on the remote NRPE machine, in the NRPE config:

Code: Select all

command[check_ADE]=/usr/libexec/check_ADE
In nagios I see:

(I added a little debug to nrpe to help determine problems)

Code: Select all

Incorrect command line arguments supplied.
Given: /usr/local/nagios/libexec/check_nrpe -H 192.168.134.220 -t 25 -c check_ADE
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 3.0.1
...

Looking at the nagios debug log, I see this:
[code]
[1480693147.637895] [2048.2] [pid=121224]   Uncleaned macro.  Running output (83): '/usr/local/nagios/libexec/check_nrpe -H 192.168.134.220 -t 25:CRITICAL -c check_ADE'
[1480693147.637904] [2048.2] [pid=121224]   Just finished macro.  Running output (83): '/usr/local/nagios/libexec/check_nrpe -H 192.168.134.220 -t 25:CRITICAL -c check_ADE'
[1480693147.637913] [2048.2] [pid=121224]   Processing part: ''
[1480693147.637922] [2048.2] [pid=121224]   Not currently in macro.  Running output (83): '/usr/local/nagios/libexec/check_nrpe -H 192.168.134.220 -t 25:CRITICAL -c check_ADE'
[1480693147.637931] [2048.1] [pid=121224]   Done.  Final output: '/usr/local/nagios/libexec/check_nrpe -H 192.168.134.220 -t 25:CRITICAL -c check_ADE'
[1480693147.637939] [2048.1] [pid=121224] **** END MACRO PROCESSING *************
So, nagios says it sends the -t 25:CRITICAL
but check_nrpe says the :CRITICAL was removed...

What do I do to get around this?
wrapping the 25:CRITICAL in quotes doesn't help.

Re: new NRPE -t option not working with Nagios

Posted: Fri Dec 02, 2016 3:27 pm
by avandemore
I have been not able to reproduce this issue. What happens if you run

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.134.220 -t 25:2 -c check_ADE
Also please note timeout settings generally can happen at 3 levels. nagios.cfg, the command level, and the NRPE cfg. These are listed in order of precedence.