Page 1 of 1

Problem with check_nrpe CheckCounters check from GUI

Posted: Thu Jan 31, 2013 4:27 pm
by hotdealdave
I am currently in the process of re-creating my organization's check_nt checks, using check_nrpe. I have gotten many of the checks migrated over now, but I am stumped right now in regards to creating checks for perfmon counters. I have gotten the check to work from the command line, but when I enter the parameters in the Nagios Core Config Manager, it fails.

Command works from the command line:
Command: ./check_nrpe -H 192.168.190.181 -p 5666 -c CheckCounter -a "\Print Queue(_Total)\Jobs Spooling" ShowAll MaxWarn=80 MaxCrit=90
Output: OK: \Print Queue(_Total)\Jobs Spooling: 0|'\Print Queue(_Total)\Jobs Spooling'=0;80;90

When testing from Core Config Manager it does not:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 128.231.190.181 -t 30 -p 5666 -c CheckCounter -a "\\Print Queue\(_Total\)\\Jobs Spooling" ShowAll MaxWarn=2 MaxCrit=20
OUTPUT: CRIT: Counter not found: \Print Queue\(_Total\)\Jobs Spooling: The specified counter could not be found. (C0000BB9)

It seems to me like Core Config Manager is adding backslashes to all the special characters in the command. Do I have to escape these out somehow, or is there another way to fix this issue?

Re: Problem with check_nrpe CheckCounters check from GUI

Posted: Thu Jan 31, 2013 5:11 pm
by slansing
Are you able to remove these slashes from the command definition itself and then run apply configuration? And then re running the test command feature.

Re: Problem with check_nrpe CheckCounters check from GUI

Posted: Thu Jan 31, 2013 7:11 pm
by JulianFDRacing
XI inserts the slashes itself, the command argument will just be the performance counter name in qoutes as per the command line version, I have the same issue

I got my counter working like so

/usr/local/nagios/libexec/check_nrpe -H 10.0.70.4 -p 5666 -c CheckCounter -a "Counter:EmailStores=\MSExchangeIS Mailbox(Quota 1 (500Mb)-Sales_Finance)\Client Logons" MaxWarn=0 MaxCrit=0 ShowAll
CRITICAL: EmailStores: 255 > critical|'EmailStores'=255;0;0

The using the argument in XI "Counter:EmailStores=\MSExchangeIS Mailbox(Quota 1 (500Mb)-Sales_Finance)\Client Logons"

Is changed to the below when you click test in ccm

/usr/local/nagios/libexec/check_nrpe -H 10.0.70.4 -t 30 -c CheckCounter -a \\"Counter:EmailStores=\\\\MSExchangeIS Mailbox\(First Storage Group-Mailbox Store \(CORE-EMAIL3\)\)\\\\Client Logons\\" MaxWarn=50 MaxCrit=100 ShowAll
CRIT: Counter not found: \Counter:EmailStores: Unable to parse the counter path. Check the format and syntax of the specified path. (C0000BC0)

How can we force XI to use the argument as is as I think the new check_nrpe versions support proper counter names without escaping characters

Re: Problem with check_nrpe CheckCounters check from GUI

Posted: Fri Feb 01, 2013 10:21 am
by abrist
Test check may still have some escaping issues. Does the check work when it is added as a full service check in XI?

Re: Problem with check_nrpe CheckCounters check from GUI

Posted: Fri Feb 01, 2013 12:06 pm
by hotdealdave
Thanks for the tips all, I finally got it working. In my case I had to double the backslashes in CCM, like this:

Command: $USER1$/check_nrpe -H $127.0.0.1$ -t 30 -p 5666 -c CheckCounter -a "\\Print Queue(_Total)\\Jobs Spooling" ShowAll MaxWarn=2 MaxCrit=20
Output: OK: \Print Queue(_Total)\Jobs Spooling: 0

So now the check works, but I can confirm that there are still escaping issues in the test check. It returns the following:

COMMAND: /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -t 30 -p 5666 -c CheckCounter -a "\\\\Print Queue\(_Total\)\\\\Jobs Spooling" ShowAll MaxWarn=2 MaxCrit=20
OUTPUT: CRIT: Counter not found: \\Print Queue\(_Total\)\\Jobs Spooling: Unable to connect to the specified computer or the computer is offline. (800007D0)

The problem is resolved for me now, so just consider this a bug report!

Re: Problem with check_nrpe CheckCounters check from GUI

Posted: Fri Feb 01, 2013 12:31 pm
by abrist
Fantastic. Go ahead and file a bug report on tracker.nagios.com if you get a chance. Cheers.