How can I monitor disk I/O speed?

Can you help me to add custom WMI monitors?

Q: Can you help me to add a custom WMI monitor? For example, what query can be used to check disk C: Read & Write Bytes per Sec?

A: The following custom WMI Query can be used:

SELECT DiskBytesPerSec FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name = "C:"

In general, if you need to read a Windows performance counter value, you should

  1. Find the corresponding Win32_PerfFormattedData-derived WMI class:
    http://msdn.microsoft.com/en-us/library/aa392397
    http://msdn.microsoft.com/en-us/library/aa394253
  2. Choose the needed class property (properties correspond to counters). For example, properties of Win32_PerfFormattedData_PerfDisk_LogicalDisk class can be found at:
    http://msdn.microsoft.com/en-us/library/aa394261
  3. Construct the WMI Query as
        SELECT <property name> FROM  WHERE Name = <instance name>
    

    Note: WHERE clause is required if there are several instances (e.g. if several logical disks are configured)

Related topics



Frequently Asked Questions

Check out our Knowledge Base where we answer questions regarding various topics.

Which WMI query can monitor C: disk read and write bytes per second?

Use SELECT DiskBytesPerSec FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name = “C:” to read the combined disk bytes per second value for drive C:.

How do I choose a WMI class for a Windows performance counter?

Find the Win32_PerfFormattedData-derived class that corresponds to the Windows performance object, then select the property that matches the counter you want to monitor.

Why is a WHERE clause often needed in a WMI performance query?

A WHERE clause selects the correct instance, such as a specific logical disk, when the WMI class can return several instances.