MSSQL Performance Counter + rights

Hi all,

we want to monitor some MSSQL Performance Countes with check_perfmon.exe. For testing we first tried it on a Windows CMD like this:

C:\Program Files\ICINGA2\sbin>check_perfmon.exe -P “\SQLServer:Databases(_Total)\Transactions/sec”
No data to return.

We wondered about the “No data to return”. For verifying we tested another (Windows own) Counter:

C:\Program Files\ICINGA2\sbin>check_perfmon.exe -P “\PhysicalDisk(0 C:)\Current Disk Queue Length”
PERFMON OK for ‘\PhysicalDisk(0 C:)\Current Disk Queue Length’ = 0 | ‘\PhysicalDisk(0 C:)\Current Disk Queue Length’=0;;;;

So this worked without any problem.

Next we startet CMD with elevated (administrative) rights and tried the MSSQL Counter again:

C:\Program Files\ICINGA2\sbin>check_perfmon.exe -P “\SQLServer:Databases(_Total)\Transactions/sec”
PERFMON OK for ‘\SQLServer:Databases(_Total)\Transactions/sec’ = 0 | ‘\SQLServer:Databases(_Total)\Transactions/sec’=0;;;;

This worked…

Also the output of “–print-object-info” is different between check_perfmon.exe startet in elevated and non-elevated CMD.
Non-elevated:
C:\Program Files\ICINGA2\sbin>check_perfmon.exe --print-object-info -P “SQLServer:Databases”
Instances of SQLServer:Databases:
>

Performance Counters of SQLServer:Databases:
> Data File(s) Size (KB)
> Log File(s) Size (KB)
> Log File(s) Used Size (KB)
[...]

Elevated:
C:\Program Files\ICINGA2\sbin>check_perfmon.exe --print-object-info -P “SQLServer:Databases”
Instances of SQLServer:Databases:
> tempdb
> model
> msdb
> mssqlsystemresource
> _Total
> master

Performance Counters of SQLServer:Databases:
> Data File(s) Size (KB)
> Log File(s) Size (KB)
> Log File(s) Used Size (KB)

Notice the “Instances” Section… in Non-Elevated its completely empty, wheras in elevated the DBs are listed as instances.

Any idea how / where one have to give which rights for the MSSQL Counter?? Obviously elevated rights are needed to read it…

Thx in advance
Markus