Problem with check_nrpe CheckCounters check from GUI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hotdealdave
Posts: 8
Joined: Fri Sep 07, 2012 10:36 am

Problem with check_nrpe CheckCounters check from GUI

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Problem with check_nrpe CheckCounters check from GUI

Post 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.
JulianFDRacing
Posts: 51
Joined: Tue Oct 16, 2012 9:45 am

Re: Problem with check_nrpe CheckCounters check from GUI

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problem with check_nrpe CheckCounters check from GUI

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
hotdealdave
Posts: 8
Joined: Fri Sep 07, 2012 10:36 am

Re: Problem with check_nrpe CheckCounters check from GUI

Post 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!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problem with check_nrpe CheckCounters check from GUI

Post by abrist »

Fantastic. Go ahead and file a bug report on tracker.nagios.com if you get a chance. Cheers.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked