1

Does anyone have links to resources that list perfmon classes that are called by the WMI Query Language? I have some monitoring software that can pull data via WMI but I have to enter a query in WMI Query Language (WQL). Here is an example:

SELECT AvgDiskQueueLength FROM Win32_PerfFormattedData_PerfDisk_logicalDisk WHERE Name="_Total"

So I have an idea of the syntax but I'm trying to figure out the different classes, specifically some of the MS SQL ones. I've tried using the Scriptomatic tool to explore the SQL server WMI info but there isn't anything related to the SQL Server.

The server OS is Windows 2003, running MS SQL Server 2000.

Alex Angas
  • 2,007
  • 2
  • 26
  • 37
David Yu
  • 1,032
  • 7
  • 14

8 Answers8

2

Here's how I do it...

  1. Start -> Run "wbemtest.exe"
  2. Connect, change Namespace to "root\cimv2", Connect
  3. Hit Enum Classes, enter superclass name "Win32_PerfFormattedData", OK

All perfmon WMI classes on that machine should now be displayed. From there you can edit the classes and see what each property is.

Nexus
  • 850
  • 1
  • 8
  • 19
2

You can use PowerShell to list classes in a namespace.

get-wmiobject -list

will list all classes in the default ("\root\cmiv2") namespace, the -namespace parameter can be used to specify a different namespace.

To get all the performance classes, use either:

get-wmiobject -list | ?{$_.Name -like 'Win32_PerfRaw*'}

for raw data, or:

get-wmiobject -list | ?{$_.Name -like 'Win32_PerfForm*'}

for formmater data. Perfmon shows formatted data (processed by counter type), raw is what the performance counter provider is sending without any further processing.

Richard
  • 5,309
  • 1
  • 22
  • 20
1

MSDN has the best list for WMI classes, but it can be difficult to track them down.

The SQL2005 classes are here. However, according to Microsoft, the "WMI Admin Provider is not pre-installed for SQL Server 2000. It needs to be installed separately using the WMI Admin Provider Setup available along with the SQL Server 2000 Setup CD under x86\other\wmi folder." Once installed it appears to use the same classes as SQL2005.

This link is to the Server 2003 WMI reference. It includes the SQL for the WMI ODBC Adapter functions, and should provide you with any nonSQL classes you are interested in.

KevinH
  • 644
  • 4
  • 7
0

http://www.solarwinds.com/products/freetools/wmi_monitor/

Works well, and it's free.

0

Piggybacking a little on Richard's Powershell answer, I've found the Powershell WMI Explorer to be a great utility for browsing around to find thing within the WMI structure.

MattB
  • 11,124
  • 1
  • 29
  • 36
0

Probably from the Scripting Guys website:

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colClasses = objWMIService.SubclassesOf()

For Each objClass in colClasses
    For Each objClassQualifier In objClass.Qualifiers_
        If LCase(objClassQualifier.Name) = "dynamic" Then
            WScript.Echo objClass.Path_.Class   & ": " & _
                         objClassQualifier.Name & "="  & _
                         objClassQualifier.Value
        End If
    Next
Next

I use this script to check or troubleshoot what classes are available on a particular computer.

RobW
  • 2,766
  • 1
  • 17
  • 22
0

Scriptomatic is a great little tool from the Scripting Guys, that works as a WMI object browser as well as outputting a basic script in VB/Perl/Python that queries that object. It's a great starting point.

Yancy
  • 89
  • 1
  • 6
0

Start here, on MSDN. Note the various classes on the left. Click whichever one you need for more detail. Within Perfmon itself you will often find more detailed descriptions of how to interpret various class objects.

quux
  • 5,358
  • 1
  • 23
  • 36