Re: How to show PF usage using VBscript?
From: Serge (serge639_at_hotmail.com)
Date: 11/18/04
- Next message: Martin R.: "Re: List, Set, Container..."
- Previous message: StephenMcC: "RE: List, Set, Container..."
- In reply to: MikeVa [MSFT]: "Re: How to show PF usage using VBscript?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Nov 2004 02:27:02 -0800
MikeVa,
Really a great script. This is what I was looking for.
I will change it not to refresh but to report it to a file and then it is
very usefull for me.
Thanks for your help.
Cheers.
Serge.
"MikeVa [MSFT]" wrote:
> Use the WMI Performance Counter Classes:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/performance_counter_classes.asp?frame=true
>
> Specifically for Memory Counters:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_perfformatteddata_perfos_memory.asp?frame=true
>
> You can find samples here:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__performance_monitoring.asp?frame=true
> http://www.microsoft.com/technet/scriptcenter/default.mspx
>
> The following example would output the 'CommitedBytes' and 'PagePerSec'
> counters every 5 seconds.
>
> '---BEGIN EXAMPLE---
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" _
> & strComputer & "\root\cimv2")
> set objRefresher = CreateObject _
> ("WbemScripting.SWbemRefresher")
> Set colItems = objRefresher.AddEnum _
> (objWMIService, "Win32_PerfFormattedData_PerfOS_Memory").objectSet
> objRefresher.Refresh
> While(true)
> For Each objItem in colItems
> Wscript.Echo "Committed Bytes: " & _
> objItem.CommittedBytes
> Wscript.Echo "Pages per Second: " & _
> objItem.PagesPerSec
> Wscript.Echo "------------------------------"
> Wscript.Sleep 5000
> objRefresher.Refresh
> Next
> Wend
> '---END EXAMPLE---
>
> --
> MikeVa [MSFT]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> --
> Please do not send e-mail directly to this alias.
> This alias is for newsgroup purposes only.
> --
> "Serge" <serge639@hotmail.com> wrote in message
> news:B3530E07-4AEA-4570-B858-2275873C7191@microsoft.com...
> >I have to report the memory in use on a server. Normally I go to the
> >Windows
> > task manager and look at the PF Usage.
> > I rather use a VBscript to show it.
> >
> > Can anyone tell me what script shows me the PF usage shown in the Windows
> > task manager?
> >
> > Serge van Lith
>
>
>
- Next message: Martin R.: "Re: List, Set, Container..."
- Previous message: StephenMcC: "RE: List, Set, Container..."
- In reply to: MikeVa [MSFT]: "Re: How to show PF usage using VBscript?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|