Service Monitoring with Special Characters

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Pponze
Posts: 8
Joined: Mon Jul 11, 2016 2:43 pm

Service Monitoring with Special Characters

Post by Pponze »

We have a Windows Internal Database for WSUS we'd like to monitor. How do we go about monitoring this service due to the special characters in the name?

Service name: MSSQL$MICROSOFT##WID

define service{
use generic-service
host_name VCAUTIL01
service_description MSSQL$MICROSOFT##WID
event_handler win_service_restart
event_handler_enabled 1
check_command check_nt!SERVICESTATE!-d SHOWALL -l $SERVICEDESC$
}


Thanks,

Paolo
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Service Monitoring with Special Characters

Post by rkennedy »

Try changing the $ to "$$" (with the double quotes), I'm not sure if you'll need to escape out the ## or not. Could you try this, and let us know what the check is reporting?
Former Nagios Employee
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Service Monitoring with Special Characters

Post by bwallace »

Your service definition will need a backslash \ and two $$ signs.

MSSQL\$$INSTANCE

Refer to this doc https://support.nagios.com/kb/article.php?id=168
Be sure to check out the Knowledgebase for helpful articles and solutions!
Pponze
Posts: 8
Joined: Mon Jul 11, 2016 2:43 pm

Re: Service Monitoring with Special Characters

Post by Pponze »

Thanks for the tips and link. Tried both "$$" and \$$. Got a check error. I did rule out that the ## doesn't require an escape. Ran a check with the name MSSQLMICROSOFT##WID and it passed.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Service Monitoring with Special Characters

Post by Box293 »

Is it resolved?

If not, can you show us your testing command from the command line and the output produced.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Pponze
Posts: 8
Joined: Mon Jul 11, 2016 2:43 pm

Re: Service Monitoring with Special Characters

Post by Pponze »

Unfortunately it's not resolved. Here is the command:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Service Monitoring with Special Characters

Post by Box293 »

Please show us your check_nt command at the command line along with the output. Before making it work in Nagios, lets see it working on the command line first.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Pponze
Posts: 8
Joined: Mon Jul 11, 2016 2:43 pm

Re: Service Monitoring with Special Characters

Post by Pponze »

Box293, would this be the correct command to run check_nt?

/usr/local/nagios/libexec/check_nt -H x.x.x.x -v SERVICESTATE -d SHOWALL -l 'MSSQL\$$MICROSOFT##WID'
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Service Monitoring with Special Characters

Post by tgriep »

Try running the command like the example below and see if this works for you

Code: Select all

/usr/local/nagios/libexec/check_nt -H x.x.x.x -v SERVICESTATE -d SHOWALL -l "MSSQL$"$"MICROSOFT##WID"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pponze
Posts: 8
Joined: Mon Jul 11, 2016 2:43 pm

Re: Service Monitoring with Special Characters

Post by Pponze »

Ran the suggested command and got this response:

root@nagios:/# /usr/local/nagios/libexec/check_nt -H 1.2.3.4 -v SERVICESTATE -d SHOWALL -l "MSSQL$"$"MICROSOFT##WID"
Connection refused
could not fetch information from server
root@nagios:/#

Got the same results pointing to the WSUS service which we're monitoring that service successfully.

root@nagios:/# /usr/local/nagios/libexec/check_nt -H 1.2.3.4 -v SERVICESTATE -d SHOWALL -l "WsusService"
Connection refused
could not fetch information from server
root@nagios:/#
Locked