Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to add Nagios checks for Windows SQL services that have a dollar sign in the name (e.g. MSSQL$TOLLCONNECT) but am so far unable to work out how to pass that name along without it being Nagios treating it as a variable name. What is the simplest way to do this, other than modifying the service name itself, which would break other things?

I'm running NSClient++ on the target machines and have considered creating checks with hard-coded names but that idea leaves a lot to be desired, as it creates a maintenance nightmare.

share|improve this question
This is shot in the dark, but have you tried escaping the $ with a \` (i.e MSSQL\$TOLLCONNECT`)? – Ben Pilbrow Nov 4 '10 at 23:41
I think the Markdown got confused with that comment and added random backticks, so I'll say it in words too! Try escaping the dollar with a backslash. – Ben Pilbrow Nov 4 '10 at 23:43
@Ben, yes I tried that first and Nagios dropped everything after the dollar sign. – John Gardeniers Nov 4 '10 at 23:57
up vote 8 down vote accepted

Had I kept searching just that little longer I wouldn't have had to ask. This web page has the answer. MSSQL"$$"TOLLCONNECT works a treat. Not the most intuitive syntax.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.