PDA

View Full Version : can python do this?


inkedmn
06-23-2002, 04:07 PM
here's what i'm after...

i need to write a script that will connect to a remote machine, get it's current resource utilization (memory, cpu, pagefile, etc.) and return it.

i've looked through the python docs and i can't really find anything that i can use to do this (that will work with both windows AND *nix).

anybody got any ideas?

jemfinch
06-23-2002, 05:33 PM
There's no standard module to do such a thing. There's no standard API even across *nices (not to mention Windows) for getting the resource usage of a machine.

On Linux, you'll be able to use the /proc filesystem.

On BSDs, you'll have to use various sysctls, which I'm sure Python has an interface to somewhere.

On Window, heckifiknow what you'll have to do.

You'll just have to have your script go to the machine and decide from there which method to use.

Jeremy

bmoyles
07-07-2002, 02:07 PM
You should be able to query a bunch of that stuff thru SNMP...