>
> I would have thought using platform.system() or os.uname to decide what set
> of commands to run, then just run some half a dozen useful command on each
> platform, making sure they do not require root access, and do not require
> things installed which people may not have.
>
>
Yes, exactly. For instance, I have a normal user account of sagenb.org and
so I figured that would be a good testing ground. Doing something like

import os, platform
OS = platform.system().lower()
if OS == "linux":
    hdware = {
        'CPU:' : 'cat /proc/cpuinfo | grep -m 1 "model name"',
        'Core Count Total:' : 'cat /proc/cpuinfo | grep -c "processor"',
        'Core Count Per CPU:' : 'cat /proc/cpuinfo | grep -m 1 "cores"',
        'Total Mem:' : 'cat /proc/meminfo | grep "MemTotal"',
        'Swap Mem:' : 'cat /proc/meminfo | grep "SwapTotal"'
        yadda yadda
....

sorting, and applying some os.system(cmd) commands, parsing the text a
bit... I can gather the following information about that machine.

Machine: Boxen
Processor: Intel(R) Xeon(R) CPU X7460 @ 2.66GHz
Processor Count: 4
Cores Per Processor: 6
Total Core Count: 24
Architecture: 64bit, 'ELF'
Mem Total: 132301916 kB
Swap Mem: 71681988 kB
Distribution: linux, Linux-2.6.24-24-server-x86_64-with-debian-lenny-sid
Dist Build: #1 SMP Fri Sep 18 16:47:05 UTC 2009
Uptime: 68 days,  4:57
Load Avg: 3.83, 4.27, 4.19
Users: 47 (sagenbws: 43, wstein: 3, other: 1)


Jason B. Hill

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to