Page 1 of 1

NSClient CheckServiceState issue

Posted: Wed Jun 11, 2014 3:52 am
by rajasegar
NagiosXI 2012R2.9
check_nrpe Version: 2.12
NSClient version 0,4,1,102

Can someone advice me how to check Windows Service Name that has () in the name?
I know I can use the short name but I want to use the long Desc.
Using Nscp test it seem fine but from check_nrpe it does not work

Without brackets in the name, works fine
[nagios@nagiosdevxi1 libexec]$ ./check_nrpe -H 10.103.4.22 -c CheckServiceState -a "Corona 76 Server" ShowAll=Long
OK: Corona 76 Server: started

With brackets does not work
[nagios@nagiosdevxi1 libexec]$ ./check_nrpe -H 10.111.1.111 -c CheckServiceState -a "Corona 76 xMi Service (corona 7.6)" ShowAll=Long
CRITICAL: Corona 76 xMi Service (corona 7.6): not found (critical)

I have tried escaping, doubling the brackets still does not work.

Thanks

Re: NSClient CheckServiceState issue

Posted: Wed Jun 11, 2014 11:44 am
by sreinhardt
I may be mistaken, but last I tried, service name was the only option to match and not description. You may try something like the link below, but since your service has spaces in the name I don't believe this will work too well.
https://www.nsclient.org/nscp/discussion/message/2415

Re: NSClient CheckServiceState issue

Posted: Wed Jun 11, 2014 6:12 pm
by rajasegar
sreinhardt wrote:I may be mistaken, but last I tried, service name was the only option to match and not description. You may try something like the link below, but since your service has spaces in the name I don't believe this will work too well.
https://www.nsclient.org/nscp/discussion/message/2415
I tried and both service and description works in most cases.
Based on your link I tried the $$ but does not work also.
check_nrpe_win!CheckServiceState!"Corona 76 xMi Service $$corona 7.6$$"!

The workaround would be to use the service name.
Hope someone has other pointers on how to get this to work.

Re: NSClient CheckServiceState issue

Posted: Wed Jun 11, 2014 10:28 pm
by Box293
I did some tests from the command line and it doesn't seem to have a problem with brackets

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.128 -c CheckServiceState -a "NSClient++ (x64)" ShowAll=Long
OK: NSClient++ (x64): started
That example is using the service Display name

Re: NSClient CheckServiceState issue

Posted: Thu Jun 12, 2014 1:07 am
by rajasegar
Box293 wrote:I did some tests from the command line and it doesn't seem to have a problem with brackets

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.128 -c CheckServiceState -a "NSClient++ (x64)" ShowAll=Long
OK: NSClient++ (x64): started
That example is using the service Display name
The support guys gave me the wrong server screenshot. :x
In this server, the shortname was the same but Long Description was different.

Please close this ticket.