Operating System - HP-UX
1834156 Members
2383 Online
110064 Solutions
New Discussion

Number of CPU under HP-UX?

 
SOLVED
Go to solution
Romaric Guilloud
Regular Advisor

Number of CPU under HP-UX?

How to retrieve the number of CPU(s) under HP-UX with a simple piece of script or under the command line interface:
I didn't find it with getconf, top -d 1 ,etc..., so if somebody has an easy way to get this info...
Thanks in advance for your help.
Romaric.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
15 REPLIES 15
Patrick Wallek
Honored Contributor
Solution

Re: Number of CPU under HP-UX?

Try this:

# ioscan -kfnC processor | grep processor | wc -l

That should give you the numnber of CPUs on your machine.
Jim Mallett
Honored Contributor

Re: Number of CPU under HP-UX?

This is what I use:
sar -Mu 1 1 | awk 'END {print NR-5}'



Jim
Hindsight is 20/20
Pete Randall
Outstanding Contributor

Re: Number of CPU under HP-UX?

ioscan -k |grep -n processor |wc -l


Pete


Pete
Romaric Guilloud
Regular Advisor

Re: Number of CPU under HP-UX?

Thank you guys for the quick answer.
I liked the sar one!
Cheers,

Romaric.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
Steven E. Protter
Exalted Contributor

Re: Number of CPU under HP-UX?

Script:

CPU=$(ioscan | grep -i processor | wc -l)

echo "CPUS: $CPU"

Solution.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hari Kumar
Trusted Contributor

Re: Number of CPU under HP-UX?

#grep processor /var/adm/syslog/syslog.log

#ioscan -fnC processor

But when u issue #top
it will automatically show on the top the CPU list , before the precesses statistics.
Here is my #top
Wed Oct 8 20:09:29 2003
Load averages: 0.02, 0.01, 0.01
93 processes: 84 sleeping, 9 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.04 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
1 0.00 0.0% 0.0% 0.4% 99.6% 0.0% 0.0% 0.0% 0.0%
--- ---- -2.2% 0.0% 0.0% 97.8-
avg 0.02 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0%
1.2% 0.0% 0.2% 98.6

Can you see under CPU coloumn the 0,1 i.e with a 2 CPU output of TOP.
Information is Wealth ; Knowledge is Power
Joshua Scott
Honored Contributor

Re: Number of CPU under HP-UX?

try this:

ioscan -fk |grep -c processor

this should output the number of cpus.
What are the chances...
Graham Cameron_1
Honored Contributor

Re: Number of CPU under HP-UX?

The "sar" and the "ioscan" options give different answers on my system - 4 and 6 respectively.
"glance" shows 4 "Active CPUs:"
"top" thinks so too.
What are the other 2 doing ?
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Joshua Scott
Honored Contributor

Re: Number of CPU under HP-UX?

Graham,

which ioscan command are you using?

-Josh
What are the chances...
Graham Cameron_1
Honored Contributor

Re: Number of CPU under HP-UX?

/usr/sbin/ioscan -kfnC processor
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
processor 0 33 processor CLAIMED PROCESSOR Processor
processor 1 37 processor CLAIMED PROCESSOR Processor
processor 2 97 processor CLAIMED PROCESSOR Processor
processor 3 101 processor CLAIMED PROCESSOR Processor
processor 4 105 processor CLAIMED PROCESSOR Processor
processor 5 109 processor CLAIMED PROCESSOR Processor
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Joshua Scott
Honored Contributor

Re: Number of CPU under HP-UX?

Graham,
What system are you running?
What are the chances...
Bernhard Mueller
Honored Contributor

Re: Number of CPU under HP-UX?

Romaric,

I am not quite sure, but your additional 2 CPUs in ioscan could be iCOD CPUs, which are there but deconfigured, i.e. inactive.

Regards,
Bernhard
Bernhard Mueller
Honored Contributor

Re: Number of CPU under HP-UX?

Sorry, I meant Graham...
Graham Cameron_1
Honored Contributor

Re: Number of CPU under HP-UX?

Joshua, Bernard (if you are still following):
--
sar -Mu 1 1

HP-UX sedling B.11.11 U 9000/800 10/09/03

08:03:23 cpu %usr %sys %wio %idle
08:03:24 0 0 0 0 99
1 0 0 11 88
2 1 2 0 96
3 3 0 0 96
system 1 1 3 95
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
T G Manikandan
Honored Contributor

Re: Number of CPU under HP-UX?

Easier ways would be


#echo "processor_count/D" | adb -k /stand/vmunix /dev/mem

#cat /var/adm/syslog/syslog.log|grep processor|wc -l