Page 1 of 1

Issue monitoring SQL based Windows services

Posted: Thu Feb 21, 2019 2:15 pm
by rferebee
Hello,

I'm attempting to monitor some SQL based services listed in Windows services and I'm encountering an error that I don't understand. These are what I'm trying to monitor:

MSSQL$ADFS -- SQL Server (ADFS) = doesn't work

MSSQL$ADMT -- SQL Server (ADMT) = doesn't work

MSSQLSERVER -- SQL Server (MSSQLSERVER) = works

MSSQL$SKYPE2015ARCMON -- SQL Server (SKYPE2015ARCMON) = doesn't work

MSSQL$SKYPE2015BACKEND -- SQL Server (SKYPE2015BACKEND) = doesn't work

Left is the service name and right is the display name. It seems the services with the '$' in the name Nagios can't find. Here's the output from the Run Check Command:

[nagios@nagiosxi ~]$ /usr/local/nagios/libexec/check_nt -H 10.131.11.170 -s "" -p 1248 -v SERVICESTATE -l MSSQL$ADFS -d SHOWALLMSSQL: Not found

The MSSQLSERVER service works fine, but the others do not. Is there some syntax issue I'm not aware of? I'm just using the built in Windows Service check (check_xi_service_nsclient).

Thank you.

Re: Issue monitoring SQL based Windows services

Posted: Thu Feb 21, 2019 2:35 pm
by scottwilkerson
You need to escape the $ with \$$

For example
MSSQL\$$ADFS

see
https://support.nagios.com/kb/article.php?id=168

Re: Issue monitoring SQL based Windows services

Posted: Thu Feb 21, 2019 3:00 pm
by SteveBeauchemin
In my Nagios XI GUI I have done this a couple ways with success.

As a $ARG1$ -a service=SQLAgent'$$'SQL10
Also simply 2 $$ next to each other where I just need one.
Like this as $ARG3$ security$$name

Funny that I never used a \ in front, though you still double up the $$. Now I need to try that and maybe have 3 ways to do it.

Thanks Scott.

Steve B

Re: Issue monitoring SQL based Windows services

Posted: Thu Feb 21, 2019 3:17 pm
by scottwilkerson
SteveBeauchemin wrote:In my Nagios XI GUI I have done this a couple ways with success.

As a $ARG1$ -a service=SQLAgent'$$'SQL10
Also simply 2 $$ next to each other where I just need one.
Like this as $ARG3$ security$$name

Funny that I never used a \ in front, though you still double up the $$. Now I need to try that and maybe have 3 ways to do it.

Thanks Scott.

Steve B
As in the doc, for some reason when passing to NSClient++ it is what's required...

good luck!

Re: Issue monitoring SQL based Windows services

Posted: Thu Feb 21, 2019 5:50 pm
by rferebee
Hmmm, it didn't work for me with \$$. I had to use a single $ with the \ and that did the trick.

Thanks all for the replies.

Re: Issue monitoring SQL based Windows services

Posted: Thu Feb 21, 2019 5:53 pm
by scottwilkerson
rferebee wrote:Hmmm, it didn't work for me with \$$. I had to use a single $ with the \ and that did the trick.

Thanks all for the replies.
Glad you got it!

Locking thread