Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to discover the machine type?

I would like to discover the machine architecture type of a big number of machines. I have the hostname of each machine. The machines have Debian 4 linux, SunOS 9, SunOS 10 or Apple Darwin. All are unix-like, but with minor differences.

I would like to know: - architecture (x86, x86_64, ia64, sparc, powerpc...) - processor type (intel pentium, pentium pro, pentium II, sparc, powerpc, itanium, athlon, core 2 duo, cytrix, etc...) - number of processors

Beware, I want the "type" of the machine. The stupid approach using 'uname' does not work on Sun and it also returns things like 'i686' when the machine is in fact 'x86_64' but the operating system is 32 bits. /proc/cpuinfo doesn't work neither, and things get even more complicated because some machines dont have a C compiler installed (I'm sure they all have sh, perhaps python or perl, dunno).

Thanks in advance!! :)

like image 795
Giovanni Funchal Avatar asked Jan 26 '09 21:01

Giovanni Funchal


1 Answers

arch ; uname -a

arch is the standard way to get the name of the CPU instruction set. uname -a gets a bunch of stuff about the OS. uname withouth the a gets the OS name.

However programmatically speaking, the equivalent to arch is uname -m.

like image 81
Joshua Avatar answered Sep 29 '22 06:09

Joshua