Page 1 of 1

Monitoring windows service with special character (#)

Posted: Wed Jul 06, 2016 6:48 am
by sify_nagios
Hi Team,

I would like to add one windows service in monitoring.
Seems the service having the special character and escape while checking the status of the service.

Service name : MSSQL$MICROSOFT##SSEE

Kindly guide to enable monitoring.

Rgds
Srini

Re: Monitoring windows service with special character (#)

Posted: Wed Jul 06, 2016 9:58 am
by rkennedy
I don't think it's the # that's messing it up, but rather the $. Try replacing it with MSSQL"$$"MICROSOFT##SE, or perhaps MSSQL\\$$MICROSOFT##SE.

Re: Monitoring windows service with special character (#)

Posted: Wed Jul 06, 2016 10:24 am
by sify_nagios
While i check from Nagios XI test command option..
I have given service name as MSSQL"$"MICROSOFT##SSEE

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nt -H 172.20.22.115 -s "" -p 12489 -v SERVICESTATE -l MSSQL"\$"MICROSOFT 
OUTPUT:  MSSQL$MICROSOFT: Not found
when i try your suggestion.

Given service name MSSQL"$$"MICROSOFT##SSEE

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nt -H 172.20.22.115 -s "" -p 12489 -v SERVICESTATE -l MSSQL"\$\$"MICROSOFT 
OUTPUT:  MSSQL$$MICROSOFT: Not found
But when i try the same from CLI it was a absolute shocker...

Code: Select all

[root@Nagiosprimary /]# /usr/local/nagios/libexec/check_nt -H 172.20.22.115 -s "" -p 12489 -v SERVICESTATE -l MSSQL"$"MICROSOFT##SSEE
 OK: All services are in their appropriate state.
[root@Nagiosprimary /]#
I wonder what i am missing.. Kindly help us out.

Rgds
Srini

Re: Monitoring windows service with special character (#)

Posted: Wed Jul 06, 2016 10:31 am
by lmiltchev
Testing from within the CCM doesn't always work properly because of escaping issues. If the check works from the CLI, the chances are it is going to work in Nagios XI as well. What is the output when you force an immediate check under "Service Status Detail".

Go to Home->Service Detail-><your service>->Configure->Re-configure this service, and show us the command that you have in the "Monitor the service with this command" field.

Re: Monitoring windows service with special character (#)

Posted: Wed Jul 06, 2016 6:21 pm
by Box293
This KB article explains the solution to your problem:
https://support.nagios.com/kb/article.php?id=168

Re: Monitoring windows service with special character (#)

Posted: Fri Jul 08, 2016 8:26 am
by sify_nagios
Hi Troy,

It seems the service returns as "All services in appropriate state".
C.JPG
I wonder whether its returning correct value or not. Bcus all other services simply says servicename is started unlike this one.
How to make sure whether its returning critical whenever the service is stopped without stopping service in client server.Please guide me on the same.

Rgds
Srini

Re: Monitoring windows service with special character (#)

Posted: Fri Jul 08, 2016 10:37 am
by lmiltchev
You may have a few, similarly named services... To show the status of all of them, add "-d SHOWALL" to your command. Here's the check_nt usage (with SERVICESTATE):
SERVICESTATE =
Check the state of one or several services.
Request a -l parameters with the following syntax:
-l <service1>,<service2>,<service3>,...
You can specify -d SHOWALL in case you want to see working services
in the returned string.