Monitoring windows service with special character (#)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sify_nagios
Posts: 54
Joined: Thu Aug 20, 2015 8:01 am

Monitoring windows service with special character (#)

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Monitoring windows service with special character (#)

Post 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.
Former Nagios Employee
sify_nagios
Posts: 54
Joined: Thu Aug 20, 2015 8:01 am

Re: Monitoring windows service with special character (#)

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring windows service with special character (#)

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring windows service with special character (#)

Post by Box293 »

This KB article explains the solution to your problem:
https://support.nagios.com/kb/article.php?id=168
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
sify_nagios
Posts: 54
Joined: Thu Aug 20, 2015 8:01 am

Re: Monitoring windows service with special character (#)

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring windows service with special character (#)

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked