Re: Number of CPU on HPUX

 
SOLVED
Go to solution
panks
Regular Advisor

Number of CPU on HPUX

Hi,

How can get the number of CPU on my box having os HPUX. I know that I can check with machinfo but I am looking for that output should only be the numbers of cpu. Like x command and output is 8 means 8 cpu. I tried with machinfo | grep -i CPUs | awk -F '{print $3}' but its not working. Any ideas or any command which will give output only in number of cpu
9 REPLIES 9
kggj
Advisor

Re: Number of CPU on HPUX

hi

# top 10 will give you the number of CPUs.

Here is the output. In this case, we have 12 CPUs.

CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.00 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
1 0.00 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.00 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%


rgds

Grayh
Trusted Contributor
Solution

Re: Number of CPU on HPUX



This would also work

# ioscan -kfnC processor | grep processor | wc -l
4
Tingli
Esteemed Contributor

Re: Number of CPU on HPUX

# machinfo | grep -i CPUs | awk '{print $5}'
panks
Regular Advisor

Re: Number of CPU on HPUX

I dont want this kind of output. I just want one number as a output of command. Like if I have 10 cpu then once I fire x command it should give 10 no other info.
panks
Regular Advisor

Re: Number of CPU on HPUX

Thanks for providing answer.
Grayh
Trusted Contributor

Re: Number of CPU on HPUX

In fact there are many ways.. You can also pick from the below:


# sar -Mu 1 1 | awk 'END {print NR-5}'
4
# ioscan -fk |grep -c processor
4

# cat /var/adm/syslog/syslog.log|grep processor|wc -l
4
Ivan Krastev
Honored Contributor

Re: Number of CPU on HPUX

Try with stm:

# echo "selclass qualifier cpu;infolog" | /usr/sbin/cstm | grep "CPU Module"


regards,
ivan
rajv
Advisor

Re: Number of CPU on HPUX

Hi,

u can use top command to see how many processor in ur system.

# machinfo
is using to see the No of CPU in rx series servers.
# print_manifest
is using to see the No of CPU in rp(PARISC) series servers.

if u want to check its a dual core ..

Login through MP console.

MP:> cm
MP:CM> ss

it will show how many processor in your system.

Thx
-VRS-
Jozef_Novak
Respected Contributor

Re: Number of CPU on HPUX

Just be aware that ioscan -fnkC processor | wc -l will give you the number of processor cores, not physical chips.

J.