[rrd-users] Re: win2k and rrd

Gustavo Badauy gbadauy at myrealbox.com
Wed Apr 7 22:43:36 MEST 2004


I've been doing this using CSCript and WMI to collect server stats.  I've
found a lot easier/simple than using SNMP

Below is a sample that migth be helpfull for the ones interested in using
RRD together with WMI to collect Windows stats.

-------
strComputer = "."
strcommand = "rrdtool update N"

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
Where Caption = 'C:'",,48)
For Each objItem in colItems
      Wscript.Echo "Size: " & objItem.Size
      strcommand =  strcommand + ":" + objItem.Size
      Wscript.Echo "FreeSpace: " & objItem.FreeSpace
      strcommand =  strcommand + ":" + objItem.FreeSpace
next



Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem",,48)
For Each objItem in colItems
    Wscript.Echo "FreePhysicalMemory: " & objItem.FreePhysicalMemory
    Wscript.Echo "FreeSpaceInPagingFiles: " & objItem.FreeSpaceInPagingFiles
    Wscript.Echo "FreeVirtualMemory: " & objItem.FreeVirtualMemory
    Wscript.Echo "NumberOfProcesses: " & objItem.NumberOfProcesse
Next


Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_ComputerSystem",,48)
For Each objItem in colItems
    Wscript.Echo "TotalPhysicalMemory: " & objItem.TotalPhysicalMemory
Next

Set WshShell = CreateObject("WScript.Shell")
WshShell.Exec (command)



----- Original Message ----- 
From: "David Puckett" <dpuckett at radioandrecords.com>
To: <rrd-users at list.ee.ethz.ch>
Sent: Wednesday, April 07, 2004 1:07 PM
Subject: [rrd-users] win2k and rrd


> Hello All,
> Can anyone send some examples of monitoring CPU and HDD on Win2k with RRD?
>
> THanks,
> david
>
>
>
>
> David Puckett
>
> dpuckett at radioandrecords.com
>
> 310-788-1634 Work
>
> 310-621-3283 Mobile
>
>
>
> Radio & Records
>
> 10100 Santa Monica Blvd
>
> Los Angeles, CA 90067
>
> www.radioandrecords.com
>
>
>
> --
> Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> Archive     http://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>
>
>

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list