Re: Got CPU Load incorrectly using script
- From: "Jim Vierra" <jvierra@xxxxxxx>
- Date: Fri, 3 Jun 2005 19:37:49 -0400
FYI - I ran your exact script on XPSP2 with NET 1.1 SP1 and NET 2.0
Installed. Get 7% or less most of the time. Since this is an instantaneous
value it probably not much good. You need to use one of the "cooked"
counters to get an average that is meaningful.
I am not sure which is which but I am sure it is documented. Some counters
are for the system while the app is running and others are agnostic. I
would read the SDK documentation very carefully to see which counter you
really want and how to use it.
--
Jim Vierra
"Yu Haitao David" <mshtyu@xxxxxxx> wrote in message
news:%236Ruz7FaFHA.2288@xxxxxxxxxxxxxxxxxxxxxxx
>I got this problem clearly after I install my .NET Framework 1.1 SP1:
>
> I have two scripts to check the CPU load and Memory usage, and I need to
> run
> them one by one to generate data for MRTG. After testing, I found this:
>
> 1. Run checkcpu.vbs first, it returns normal value, 5% for example. There
> appears a process named: wmiprvse.exe
> 2. Run checkmem.vbs then, it gets error: 80041010
>
> if I kill the process wmiprvse.exe that appeared when doing step 1, I
> change
> the order of these two scripts:
>
> 1. Run checkmem.vbs first, it returns normally, another wmiprvse.exe
> appears
> 2. Run checkcpu.vbs then, it runs longer, and return 100% which is
> incorrect
>
> anyone can help me on this?
>
>
>
> "Yu Haitao David" <davidyu@xxxxxxxxxxx> дÈëÓʼþ
> news:OwSGKHBaFHA.2996@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I got my CPU load value of 100% whatever it really was in taskmgr.
>>
>> I tried using "Win32_Processor.LoadPercentage" and
>> "Win32_PerfFormattedData_PerfOS_Processor_PercentProcessorTime", always
>> 100%, while actually the load was below 20%.
>>
>> But the script works normally under win2k.
>>
>> My PC has winxp-sp1, and the script like the followings:
>>
>> '=================================
>> On Error Resume Next
>> strComputer = "."
>> Set objWMIService = GetObject("winmgmts:\\" & strComputer &
>> "\root\cimv2")
>> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_Processor",,48)
>>
>> For Each objItem in colItems
>> WScript.Echo "LoadPercentage: " & objItem.LoadPercentage
>> Next
>>
>>
>
>
.
- Follow-Ups:
- Re: Got CPU Load incorrectly using script
- From: Yu Haitao David
- Re: Got CPU Load incorrectly using script
- References:
- Got CPU Load incorrectly using script
- From: Yu Haitao David
- Re: Got CPU Load incorrectly using script
- From: Yu Haitao David
- Got CPU Load incorrectly using script
- Prev by Date: Re: Got CPU Load incorrectly using script
- Next by Date: Re: Login script with admin priveleges
- Previous by thread: Re: Got CPU Load incorrectly using script
- Next by thread: Re: Got CPU Load incorrectly using script
- Index(es):
Relevant Pages
|
Loading