check_nrpe loses minus sign in the performance data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagiosadmin42
Posts: 96
Joined: Sat Feb 11, 2012 2:16 pm

check_nrpe loses minus sign in the performance data

Post by nagiosadmin42 »

CentOS 6.3, Nagios XI 2012R1.0, NSClient++ 0.4.0.183, check_nrpe 2.12

We're using active service checks to monitor the NTP time difference on remote Windows hosts, which are running NSClient++.

It appears that check_nrpe loses the minus sign in the performance data when the NTP offset value is negative.

Here is an example.

On the Windows remote host:

1) NSClient++ config entry for the "check_time" command:

Code: Select all

[/settings/external scripts/scripts]
check_time=cscript.exe //NoLogo "D:/Progra~1/NSClient++/scripts/check_time.vbs" time.windows.com 20.0 30.0
2) Run the command manually from the console, things look fine, i.e. the minus sign appears in the status string and performance data:

Code: Select all

D:\Program Files (x86)\NSClient++>cscript.exe //NoLogo "D:/Progra~1/NSClient++/scripts/check_time.vbs" time.windows.com 20.0 30.0
NTP OK: Offset -0.4702899 secs|'offset'=-0.4702899s;20.0;30.0;0
On the Nagios XI monitoring server:

1) Service command definition is:

Code: Select all

$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$

Where $ARG1$ is check_time and no other arguments are specified.
2) Run the command manually from the console, the minus sign appears in the status string however NOT in the performance data:

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H 192.168.30.40 -t 30 -c check_time
NTP OK: Offset -0.5256143 secs|'offset'=0.52561s;20;30
The check_nrpe version info is:

Code: Select all

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.12
Last Modified: 03-10-2008
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe loses minus sign in the performance data

Post by lmiltchev »

It sounds like a bug in NSClient++.

http://www.nsclient.org/nscp/discussion/message/2763

Not sure what versions are affected.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nagiosadmin42
Posts: 96
Joined: Sat Feb 11, 2012 2:16 pm

Re: check_nrpe loses minus sign in the performance data

Post by nagiosadmin42 »

Thanks for the pointer to the NSClient++ bug. From that thread, it does indeed appear to be in that rather than check_nrpe.

Because I can't wait for a fix to NSClient++, I'll modify process_perfdata.pl to modify the performance data string using the value that is in the status string.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nrpe loses minus sign in the performance data

Post by lmiltchev »

Sounds good! I am locking this topic, then. If you have more issues, please, start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked