special characters in host names

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mstrorange
Posts: 2
Joined: Wed Jul 04, 2012 11:16 am

special characters in host names

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: special characters in host names

Post by scottwilkerson »

Try wrapping the hostname in single quotes.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mstrorange
Posts: 2
Joined: Wed Jul 04, 2012 11:16 am

Re: special characters in host names

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: special characters in host names

Post 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.
Former Nagios Employee
Locked