Quantcast
Channel: Operations Manager - General forum
Viewing all articles
Browse latest Browse all 11941

Unable to create Property bag output SCOM 2012

$
0
0

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)


Viewing all articles
Browse latest Browse all 11941

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>