Page 1 of 1

MSSQL query with $ character

Posted: Mon Jan 02, 2012 4:35 am
by nagiosnext
Hello Supporter,

currently I'm trying to query a german MSSQL for a database size with:

Code: Select all

./check_nt -H 192.168.11.211 -p 12489 -v COUNTER -l "\\MSSQL$BES:Datenbanken(_Total)\\Größe der Datendatei(en) (KB)"
The service name is: SQL Server (BES)
The name from performance counters is MSSQL$BES

However, it always shows me a 0, where the real database is > 0. So I assume I have to handle $ in a different way.

Does anyone have a suitable idea how to handle it?

Re: MSSQL query with $ character

Posted: Mon Jan 02, 2012 1:57 pm
by mguthrie

Re: MSSQL query with $ character

Posted: Mon Jan 02, 2012 2:01 pm
by nagiosnext
Hey mguthrie,

the solution might help. I found a solution till my request got a approved. My solution was:

Code: Select all

./check_nt -H IP -p PORT -v COUNTER -l "\\MSSQL\$BES:Datenbanken(_Total)\\Größe der Datendatei(en) (KB)"
Thanks for your assistance