Hello,
I've created the script for logical disk and using the script created probe based perf collection rule. Script collects same value for all the drives. I'm unable to trace the issue with script. Could anyone please help me?
I've already posted in this forum and got few responses and it helped me to fix few errors and make the script working but now the issue is it is not collecting values exactly?
'On Error Resume Next
CONST MB = 1048576
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oArgs = WScript.Arguments
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer& "\root\cimv2")
Set colLogicalDisk = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
Where DriveType=3")
For each objLogicalDisk in colLogicalDisk
diskUsedMB = ((objLogicalDisk.size - objLogicalDisk.freespace)/MB)
Next
Set oBag = oAPI.CreatePropertyBag()
call oBag.AddValue ("UsedSpace", diskusedMB)
Call oAPI.Return(oBag)