Page 1 of 1

special characters in host names

Posted: Wed Jul 04, 2012 11:23 am
by mstrorange
i have a plugin to check query restulst from MS SQL Server. This plugin works perfectly when the name of the server does not have any special characters. However in the sample below the database or server name requires a \ character and i can't figure our how to add that character.

check_xi_mssql_query!-H 172.27.167.27\sqlexpress --port 1433 --username nagios_dbuser --password "m9BLdHPinq" --database EAF --query 'select * from nagios_tampa_pull' --result '1' --critical 100

The above is the command that i am trying to run (via a wizard). it keeps telling me there is an invalid character in the host name (172.27.167.27\sqlexpress) but i need the back slash

Re: special characters in host names

Posted: Thu Jul 05, 2012 11:38 am
by scottwilkerson
Try wrapping the hostname in single quotes.

Re: special characters in host names

Posted: Wed Mar 09, 2016 10:52 am
by mstrorange
After quite some time I'm actually getting back to this issue.

I have tried single quotes, double quotes, single quotes with \\, double quotes with \\, no quotes with \\. I've even tried \\\

Nothing I try will allow me to connect to a sql server express database because of the \ in the name.

Re: special characters in host names

Posted: Wed Mar 09, 2016 11:02 am
by rkennedy
The hostname shouldn't have a \ in it, as the script is trying to connect to that IP. What exactly does the \sqlexpress part do? The option may need to be added elsewhere in the command.