I-8 Accessing Power and Performance Data
PROCESSOR UTILIZATION
To collect the utilization of processors, use Win32_PerfFormattedData_PerfOS_Processor class
provided with the Windows OS.
Shown below is a sample file created by Visual Basic Script (e.g. Proc.vbs).
In this script, the processor utilization is collected every 30 seconds.
' Start Script
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objRefresher = CreateObject("WbemScripting.Swbemrefresher")
Set objProcessor = objRefresher.AddEnum _
(objWMIService, "Win32_PerfFormattedData_PerfOS_Processor").objectSet
objRefresher.Refresh
Dim first
first = true
Do
For each intProcessorUse in objProcessor
If first Then
If intProcessorUse.Name = "_Total" Then
first = false
End If
else
Wscript.Echo "Proc" & intProcessorUse.Name & " : " & _
"PercentProcessorTime=" & _
intProcessorUse.PercentProcessorTime
End If
Next
Wscript.Sleep 30*1000 'sleep 30 * 1000ms
objRefresher.Refresh
Loop
' End Script
Command Line (Example)
C:\VBS> cscript //nologo Proc.vbs
Содержание Express5800/R120b-1
Страница 20: ...Notes on Using Your Server 1 3 3 5 inch disk model...
Страница 87: ...3 24 Setting Up Your Server This page is intentionally left blank...
Страница 264: ...6 10 Installing and Using Utilities 4 Click Parameter File Creator Parameter File Creator will appear...
Страница 268: ...6 14 Installing and Using Utilities Windows Server 2003...
Страница 296: ...7 14 Maintenance This page is intentionally left blank...
Страница 350: ...8 54 Troubleshooting When you use a remote console 6 Each tool is selected and it starts...
Страница 438: ...9 82 Upgrading Your Server This page is intentionally left blank...
Страница 450: ...C 2 IRQ This page is intentionally left blank...
Страница 474: ...D 24 Installing Windows Server 2008 R2 4 Activate Windows The Windows activation is complete...
Страница 504: ...E 28 Installing Windows Server 2008 4 Activate Windows The Windows activation is complete...
Страница 564: ......
Страница 566: ...H 2 Using a Client Computer Which Has a CD Drive This page is intentionally left blank...
Страница 576: ...I 10 Accessing Power and Performance Data This page is intentionally left blank...
Страница 580: ...J 4 Product Configuration Record Table This page is intentionally left blank...