Operating System - HP-UX
1833847 Members
1916 Online
110063 Solutions
New Discussion

Re: Determine number of CPUs on the system

 
SOLVED
Go to solution

Determine number of CPUs on the system

Does anyone know is there is a utility that can be used in a script that will list the number of CPUs on the system (optinally with the clock speed) similar to the way "top" lists them out. I tried piping the output from top -d1 into a file, but it gets all jumbled up. Any help would be much appreciated. Thank you in advance.
7 REPLIES 7
Craig Rants
Honored Contributor
Solution

Re: Determine number of CPUs on the system

To find processor speed

echo itick_per_usec/D | adb -k /stand/vmunix /dev/mem

To find # of processors used

echo runningprocs/D | adb -k /stand/vmunix /dev/mem

Hope this helps,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Helen French
Honored Contributor

Re: Determine number of CPUs on the system

Hi,

Check this out:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x15aca2db8513d6118ff40090279cd0f9,00.html

HTH,
Shiju

Life is a promise, fulfill it!
James R. Ferguson
Acclaimed Contributor

Re: Determine number of CPUs on the system

Hi:

For the number of CPUs (by root or by a non-privileged user):

# sar -M 1 1|awk 'END {print NR-5}'

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: Determine number of CPUs on the system

hi,

You can list the no of processors on the system using ioscan too,

ioscan -fn |grep processor |wc -l

to get the processor speed,

- For HP-UX 9.x:
echo itick_per_usec/D | adb -k /hp-ux /dev/mem,

for 10.x and above
echo itick_per_usec/D | adb -k /stand/vmunix dev/mem

Hope this helps.

Regds


James George_1
Trusted Contributor

Re: Determine number of CPUs on the system

Hi

Use the top command and grep what you want !!!

# top 10

Rgds / James


forum is for techies .....heaven is for those who are born again !!
Kerilyn O'Donnell
Contributor

Re: Determine number of CPUs on the system

I don't know what OS and system you are running - but with Solaris2.6 (there is probably an equivalent for what you are using) I can run the following command to get the speed and number of my CPUs - you may just need to cut what you want from the output:

/usr/platform/sun4u/sbin/prtdiag -v

Re: Determine number of CPUs on the system

You guys are the best. Don't ever give up your day jobs or we'll all be screwed. Thanks for all your help.