[python-win32] monitoring process vm size
Tim Golden
tim.golden at viacom-outdoor.co.uk
Thu Jul 31 09:42:59 EDT 2003
> From: Nate Gelbard [mailto:gelbardn at tripwire.com]
> I'm trying to write a python script to monitor
> the vm size (and perhaps cpu utilization)
> of a handful of JVMs on Win2k and XP.
> Is win32pdh what I am after, or is there another
> interface to the Task Manager?
Can't claim to be an expert here, but WMI can give you
quite a lot of info about processes. Get hold of the
wmi module from http://tgolden.sc.sabren.com/python/wmi.html
and try something like the following:
<code>
import wmi
computer = wmi.WMI ()
for process in computer.Win32_Process ():
print process
</code>
This will list various attributes of all the processes
currently running on the local computer. You can
specify a remote computer in the WMI constructor,
and/or can keep track of when processes are started
or stopped or go over a certain limit etc.
HTH.
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
More information about the Python-win32
mailing list