MSSQL query with $ character

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagiosnext
Posts: 12
Joined: Mon Jan 02, 2012 4:21 am
Location: Germany

MSSQL query with $ character

Post 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?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: MSSQL query with $ character

Post by mguthrie »

nagiosnext
Posts: 12
Joined: Mon Jan 02, 2012 4:21 am
Location: Germany

Re: MSSQL query with $ character

Post 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
Locked