Get the Processor Type on Solaris
It's easy to get the type of processor that a Solaris box is running on. While this might seem like a silly thing to need to know, if you are connected into a Solaris server at a remote location, you may need to know what type of processor is being used in order to install the correct packages.
uname -p
The uname command gives information about the current system.
Example on an Intel box:
# uname -p
i.386
Example on an Sun Sparc box:
# uname -p
sparc
The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 12/1/06 and tagged with: Solaris


As part of script I've made to automatically get HW details of our servers (HP9000, Solaris, Fujitsu, AIX,…) this function give you information about processor number, type and speed:
function sunos_hw_CPU {
typeset num=$( psrinfo | wc -l )
typeset tipo=$(
prtconf -pvPD | egrep -e "device_type.*cpu|name" |
sed -n "/device_type/{n;p;}" | awk -F\' '{ print $2 }' |
sed -e "s/SUNW,//" | head -1
)
if [ "$tipo" == "cpu" ]
then
tipo=$(
prtconf -pvPD | egrep -e "device_type.*cpu|compatible" |
sed -n "/device_type/{n;p;}" | awk -F\' '{ print $2 }' |
sed -e "s/SUNW,//" | head -1
)
fi
typeset freq=$(
/usr/sbin/psrinfo -v| grep operate | sed -e "s/.*at //;s/,//" |
head -1
)
echo $num \"$tipo $freq\"
}
# sunos_hw_CPU
16 "UltraSPARC-IV 1350 MHz"
Enjoy it
!
Alex, thanks!
That's a great script… I might convert it into linux…
As part of the same script, I've done this function for Linux (including VMware ESX servers):
function linux_hw_CPU {
typeset num=0
typeset name=""
typeset cores=""
name="$(
cat /proc/cpuinfo | awk -F: '
/vendor_id/ { vendor=$2 }
/model name/ { model=$2 }
/cpu MHz/ {
if( model ~ "Hz" ) {speed=""} else { speed=$2″ MHz" };
print vendor, model, speed; }
' | tail -1
)"
num=$(
if [ -r /proc/vmware/cpuinfo ]
then
awk '/pcpu/ { print NF-1 }' /proc/vmware/cpuinfo
else
cat /proc/cpuinfo | grep processor| wc -l
fi
)
# ESX: mas info sobre logical/cores/packages
if [ -r /proc/vmware/sched/ncpus ]
then
cores=$( echo $( cat /proc/vmware/sched/ncpus ) )
fi
echo $num $( echo "$name ($cores)" | enclose )
}
For example, in one of our ESX box, I get:
32 "GenuineIntel Intel(R) Xeon(TM) CPU 3.00GHz (32 logical 16 cores 8 packages)"
(ESX is nice, it gives me information about chip, cores and also logical (that is because hyperthreading is activates on that box).
A normal linux server (not ESX) would give something more simple like:
2 "GenuineIntel Pentium III (Coppermine) 696.417 MHz ()"
Hope it helps
Alex : ¿ Its posible to get the complete set of scripts to identify the hw?..thanks in advance