win32pdhutil - Returning Processor Information

Ben C benc1 at today.com.au
Mon Aug 12 01:10:01 EDT 2002


Hi there,

I am attempting to write a load balancer for a W2K server and am
planning to use the win32pdhutil module to return performance data
about the machine ... however I am not having much luck returning any
information from a 'Processor' object ... but can return instance
information from a 'Memory' object ... I have looked dumbly at this
for a while and if anyone could point out what I am doing here that
would be great

thanks in advance

Ben

# FROM PYTHON ENVIRONMENT

>>> import win32pdhutil
>>> 
>>> win32pdhutil.browse()
>>>
Value of '\\LINUX\Processor(_Total)\% Processor Time' is 99.9957483479
Added '% Processor Time' on object 'Processor' (machine \\LINUX),
instance _Total(0)-parent of None
>>>
>>> win32pdhutil.GetPerformanceAttributes("Memory", "Available Bytes")
140390400
>>> 
>>> win32pdhutil.GetPerformanceAttributes("Processor", "% Processor
Time")
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python21\win32\Lib\win32pdhutil.py", line 29, in
GetPerformanceAttributes
    hc = win32pdh.AddCounter(hq, path)
api_error: (-1073738816, 'AddCounter', 'No error message is
available')
>>>



More information about the Python-list mailing list