Escaping check parameters in Director


I’m trying to check a Windows SQL Server instance through a service template in Director but hitting an issue because Director doesn’t like the $ in the service name,. i.e. MSSQL$MICROSOFTSCM

I’ve tried various techniques to escape the the $ such as;




None seem to work, they i.e. deploy and error on the client or Director errors during rendering.

I’ve check the check command locally, that works without escaping.
check_service.exe -s MSSQL\\$MICROSOFTSCM

Any suggestions on how to escape.

Template looks like this;

## zones.d/director-global/service_templates.conf
template Service "winservice BackupExec SQL Server"  { 
         import "[Windows BackupExec Server Services]
         check_command = "[service-windows]
        groups = [ "Service Blah lbah" ] 
       command_endpoint = host_name 
       vars.service_win_service = "MSSQL\\$$MICROSOFTSCM" }


have you tried to use only MSSQL$$MICROSOFTSCM?

When using the $ sign as single character you must escape it with an additional dollar character ( $$ ).


1 Like

Wow, not sure why I didn’t try that… yep it worked thanks.