Adding a WMI monitor

Adding a WMI monitor

I'm attempting to add my own WMI monitor using information from the following thread:

http://forums.manageengine.com/forumHome.do?forumGroupId=49000000002007&forumTopicId=49000002634179

I'm attempting to monitor virtual memory statistics with one script and disk queue length statistics.

Here's what I have for virtual memory:

script (just the important parts):
Set colItems = wbemServices.ExecQuery("Select * from Win32_OperatingSystem",,48)
if Err.Number Then
WScript.Echo vbCrLf & "Error # " & _
" " & Err.Description
End If
On Error GoTo 0

For Each objItem in colItems
WScript.Echo "FreePhysicalMemory" & vbTab & objItem.FreePhysicalMemory
WScript.Echo "FreeVirtualMemory" & vbTab & objItem.FreeVirtualMemory
WScript.Echo "TotalVirtualMemory" & vbTab & objItem.TotalVirtualMemorySize
WScript.Echo "PercentFreeVirtMem" & vbTab & CStr(Round(((objItem.FreeVirtualMemory / objItem.TotalVirtualMemorySize) * 100),0))
Next

WScript.Quit(0)















hostresouce.xml:
<CATEGORY ID="WMIVirtualMemory" command="vmem.vbs" parseAll="true" description="WMI Virtual Memory statistics">
<ENTITY ID="FreeVirtualMemory" storeValue="Value2" storeHistory="true" units="Bytes">
<PARSE line="4" token="2" name="Value2"/>
</ENTITY>
<ENTITY ID="TotalVirtualMemory" storeValue="Value3" storeHistory="true" units="Bytes">
<PARSE line="5" token="2" name="Value3"/>
</ENTITY>
<ENTITY ID="PercentVirtualMemoryFree" storeValue="Value4" storeHistory="true" units="%">
<PARSE line="6" token="2" name="Value4"/>
</ENTITY>
</CATEGORY>











graphinfo.xml:
<DEFAULTGRAPH Name="WMIVirtualMemory">
<YAXISTEXT>Percentage</YAXISTEXT>
<DISPLAYNAME>WMI virtual memory statistics</DISPLAYNAME>
<name>WMIVirtualMemory</name>
<Vendor>WMI</Vendor>
<Description>Monitors virtual memory statistics</Description>
<oid>WMIVirtualMemory</oid>
<Provider>WMI</Provider>
<Monitor>Resource</Monitor>
<type>multiple</type>
<interval>5</interval>
<THRESHOLDENABLED>false</THRESHOLDENABLED>
</DEFAULTGRAPH>













I've attached a picture of what I'm seeing in Opmanager. Obviously the Copyright and Microsoft lines shouldnt' be parsed, and I don't know why they are.

Secondly, I'd like to setup a WMI monitor for Disk Queue length, but this is more complicated, since each computer has a varying number of physical disks to monitor... how would I approach that?


















                  New to ADSelfService Plus?