Escaping the $ in MSSQL service names (check_nt)
Posted: Thu Oct 27, 2016 7:50 am
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.
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.