I needed to create my own drive monitor APM (in order to encorporate TSM backup volumes in my calculations).
All is working fine except for Win 2000. The issue is the WMI property Win32_PerfFormattedData_PerfDisk_LogicalDisk does not exist on many (about 100) of them. My script traps for an error but no error is reported and the durn thing reports a size zero.
I log onto the server... see that Win32_Perf* does not exist in WMI. I would expect the query to return some non-zero Err.Number.
Anyone run into this? Here is a code snippet...
On Error Resume Next
'Get amount free megabytes from volume
strQuery = "SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk WHERE Name LIKE '" & strVolume & ":%'"
Set colItems = objWMIService.ExecQuery(strQuery,,48)
CALL ErrorCheck(Err.Number, strQuery)
if( IsNull(colItems) ) then
Err.Number = 99
CALL ErrorCheck(Err.Number, strQuery)
End If
For Each objItem in colItems
intFreeMb = objItem.FreeMegabytes
Next