What's the easiest way to display system cpu, memory, # drives/size ??

I am looking for the easiest and most generic way
to determine:

System model/class
Number of cpu's
Clock speed of cpu's (ie 550 MHz)
Total Physical Memory (not virtual)
Number of Drives/Drive Size

Thanks in advance,

For what OS are you looking to get this complete information? For linux if you installed KDE or GNU they include a user friendly Xsystem panel for you to check those information called "Process Managment".

  • For solaris mysys> prtconf | grep Mem for checking on the Memory size, top command, primarily used to identify a system's most resource-consuming processes, also provides a synopsis of memory and memory usage.

  • If you still unable to figured out what you are looking for, then check your MAN page depending on what UNIX os you are using the commands might vary..

in Solaris, you may try

/usr/platform/YourMachineModel/sbin/prtdiag

i.e. /usr/platform/sun4u/sbin/prtdiag
or /usr/platform/SUNW,Ultra-1/sbin/prtdiag
hope this help

:wink:

You can also pull a lot of that information out of the `dmesg` output.

That is normally the first place that I look...

There you probably have the only real way to do it.
I have never seen that SunOS stuff on any other system, and if I should vote between that and GNU /proc, I'd vote for the latter.

But in dmesg you find what the system found, and dmesg is on all systems I know about.

Could you tell us what you want this information for?

These are the commands I found that deal with some of this:

uname - Will tell you about the system name
top - You may parse some of this stuff and
draw inferences from it
df - This tells you about drives and free
space (parse for NFS mounts!)

To determine system speed, you have to make a small program, I guess.
Time a loop or something, maybe invalidate the cache inside the loop, determine what you want as criterion, and divide that by the time it took to run.

double d, dd;
long i;
long t = \(long\)time\(\);
d = \(double\) t;

for (i=0; i < LOOPCNTR; i++)
invalidate_cache();
t = (long) time();
dd = (double) t;

time\_it_took = dd - d;

system_speed = criterion / time\_it_took;

You could fork one for each 'suspected' process and time it again. With a few if's - like each new process is given a new processor, you may infer the number of processor by multiplying time_it_took by the number of forks and compare.

This is a BFAMI(*) approach that might work.

Physical memry can be determined with a

long *p = 0;
while\(p\+\+\);

loop that evenually will seqfault.
Trap that, and check the count.
Another BFAMI approach.

A structured approach is write to the POSIX guys and tell them: "Hey, I think we need a portable way of determining the system configuration, like CPUs, memory, disks, etc."

Maybe they'll listen.

Write an RFC.

Pray.

Atle

(*)(BFAMI = brute-force-and-massive-ignorance)