Escaping the $ in MSSQL service names (check_nt)

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.
Locked
ianj
Posts: 1
Joined: Thu Oct 27, 2016 7:22 am

Escaping the $ in MSSQL service names (check_nt)

Post by ianj »

I am running nagios-4.0.8-2 on Centos 7 and have just spent many hours trying to get check_nt to check a MSSQL service that contains a '$' in the middle, ie MSSQL$INSTANCE. I found many discussions regarding this issue with different methods of escaping the '$' with different versions of Nagios ranging from various quotes, $$, \\$$ and combinations of all of the above, none however worked for me with Nagios 4. After much trial, testing, many rescheduled checks, and plenty of errors, I finally found something that worked that I can't find documented anywhere else. It was so much trouble for me I joined this forum just to save anybody else this tedious journey. What worked for me is this...

check_nt!SERVICESTATE!-d SHOWALL -l MSSQL'$$'INSTANCE

Single quotes surrounding just the two '$' characters. I am not sure if this is a bug or by design but I certainly hope I save somebody else the hours I spent on this.
padu_3891
Posts: 50
Joined: Thu Sep 05, 2013 10:12 pm

Re: Escaping the $ in MSSQL service names (check_nt)

Post by padu_3891 »

For the same issue i got one more solution . I have added a slash \ in front of dollor symbols as \$$ and that worked for me .
Locked