python module to determine if a machine is idle/free

Chris Rebert clp2 at rebertia.com
Thu Aug 4 06:38:34 CEST 2011


On Wed, Aug 3, 2011 at 9:06 PM, Danny Wong (dannwong)
<dannwong at cisco.com> wrote:
> Hi all,
>
>                 I have 5 server machines that are using to process
> information. I would like to write a quick server python script that
> determines which of the machines are not in use. Any recommendations on
> which python module I should use to detect if a machine is not performing
> idle (ex. Some specific task is not running)?

Yes, psutil:
http://code.google.com/p/psutil/

os.getloadavg() may or may not also be useful to you:
http://docs.python.org/library/os.html#os.getloadavg

Cheers,
Chris



More information about the Python-list mailing list