Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:module': 0.04; 'python': 0.08; 'danny': 0.09; 'determines': 0.09; 'wed,': 0.12; 'subject:python': 0.12; 'wrote:': 0.15; 'skip:\xc2 30': 0.16; 'cc:addr:python-list': 0.16; 'pm,': 0.16; 'aug': 0.19; 'cheers,': 0.19; 'cc:2**0': 0.21; 'detect': 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'received:209.85.213.46': 0.23; 'received:mail-yw0-f46.google.com': 0.23; 'url:code': 0.23; 'performing': 0.26; 'all,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'server': 0.29; 'script': 0.29; 'idle': 0.29; 'cc:addr:python.org': 0.30; 'module': 0.30; 'url:library': 0.31; 'chris': 0.32; 'machine': 0.35; 'subject:/': 0.36; 'url:python': 0.37; 'useful': 0.37; 'some': 0.37; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'url:docs': 0.39; 'received:209': 0.40; 'url:p': 0.63; '8bit%:100': 0.70; 'you:': 0.80; 'sender:addr:chris': 0.84; 'url:os': 0.84; 'subject:free': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CaqZHOof4JjGTdoTvXgpHoIauo3a9022uKsBCX1eDqk=; b=TF9x2IvE1ChVS6FYTbs2274aIlVbSk0rlUShB7dtc7CY4m1as4adPpaHSeX9RgTnI4 ZPvReHFaBaT64/GPvV591QqAyIYFM7EZI8T/pe9NKB/VjrwRdd7gggLFF7cdcUiomXDF cjTrzG2Rj21l79KBytypn0M2xhK/RYdND8wak= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: References: <062306c6-3ee6-43ce-936f-ca9cc0f013c9@eb9g2000vbb.googlegroups.com> Date: Wed, 3 Aug 2011 21:38:34 -0700 X-Google-Sender-Auth: ewHjbpGZOxm9RtK-a-NTyIH6fPA Subject: Re: python module to determine if a machine is idle/free From: Chris Rebert To: "Danny Wong (dannwong)" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1312432716 news.xs4all.nl 23967 [2001:888:2000:d::a6]:34324 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:10840 On Wed, Aug 3, 2011 at 9:06 PM, Danny Wong (dannwong) wrote: > Hi all, > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 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