Extracting info from OS/hardware

os moma os-moma at email.no
Wed Mar 17 02:29:36 EST 2004


Hello Laird,

Combine "lshw" (list hardware),
         "free" (total/free/used/shared memory) and
         "df"   (disk free/used) commands.

Study the GPL'ed source.

1) http://ezix.sourceforge.net/software/lshw.html

(sample output: http://www.futuredesktop.org/hw/lshw_moma.html )

2) "free", "du" and "df" are propably part of the GNU coreutils package.

Your tool should support the kernel-v2.6 (who cares about v2.4 any more ?).

It should have these content formats:
  -t html  || --type=html
  -t xml
  -t text    (default)
  -t query   (should return only one value. Anwsers to a question)

And output types:
  -o 1   (compact format. One text line pr. device)
  -o 2   (short format)
  -o 3   (long, complete format. Default)

...


// moma
    http://www.futuredesktop.org  (newbie links at the top -(:-o


Cameron Laird wrote:
> In article <nOq3c.9451$_c4.119500 at news4.e.nsc.no>,
> Thomas Weholt <2002 at weholt.org> wrote:
> 
>>I need a piece of code to extract as much info about OS, current status and
>>hardware from a machine as possible ( at least, all available partitions and
>>free space on these, CPU-speed, free/total memory and stuff like that ) at
>>one given moment on Linux and Windows.
>>
>>Any hints? Can I call something in win32all on Windows or read some file on
>>linux? I'm not sure where to begin.
> 
> 			.
> 			.
> 			.
> I was hoping someone else would answer this.
> 
> My impression is that there are dozens of answers to this.
> I know I've seen quite a few such utilities advertised in
> places like Freshmeat.  I haven't kept track of them at 
> all.  
> 
> "... as much info ... as possible ...":  whoooo!  Usually
> when a manager says that to me, I ask for how much he's 
> willing to pay.  As it turns out, notions like "free 
> space", "CPU speed", and so on are surprisingly poorly
> standardized.  It's far from clear what they mean for any
> particular platform.
> 
> Sooooooo, what I usually do is define my requirements 
> carefully, and write up my own tool.




More information about the Python-list mailing list