Operating System - HP-UX
1837853 Members
2896 Online
110122 Solutions
New Discussion

Re: identify the number of CPU on HPUX

 
SOLVED
Go to solution
John Chan
New Member

identify the number of CPU on HPUX

Is there a shell command on HPUX 10.x that show the numbers of CPU ? The "top" output is messed up when it's captured to a file. I am a non-root user, therefore cannot access to dmesg. We have over 50 servers, I want to write a script to identify the number of CPU on each server.

any idea ?

JohnC
yes, boss, it's my job
9 REPLIES 9
Rick Garland
Honored Contributor

Re: identify the number of CPU on HPUX

top will display the # of cpu's. If your display is not showing it correctl, I would suspect that the DISPLAY variable is not set correctly. Can alos use sar -M
Rick Garland
Honored Contributor

Re: identify the number of CPU on HPUX

If you are wanting to capture the output to a file, you will probably want to use awk and printf to format the fields to fixed lengths.

The sar -M can be run as non-root
Cheryl Griffin
Honored Contributor
Solution

Re: identify the number of CPU on HPUX

John,

You stated that the top output is misformatted when captured to a file. Are you using:
# top -f /tmp/top.out

This should give you a fairly decently formatted report.

It's an undocumented feature. :^)
"Downtime is a Crime."
Eddie Warren
Valued Contributor

Re: identify the number of CPU on HPUX

Hi John,

sar -M 1 5 will show cpu usage for five seconds. this will show you the number of cpus. as stated earlier you can direct this output to a file. The -M option is specifically for multiple cpu systems. Also you can use the "stm" command to get a complete view of the system. Hope this helps.
CHRIS_ANORUO
Honored Contributor

Re: identify the number of CPU on HPUX

You can also use sar -M and tail command
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
CHRIS_ANORUO
Honored Contributor

Re: identify the number of CPU on HPUX

You can also use sar -M and tail command
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Michael A. Acosta
New Member

Re: identify the number of CPU on HPUX

I'm not familiar with the "stm" command. I'm looking at a HP R390 running HPUX 11.0 and don't see the command. Is it part of a separate optional package?
Antoanetta Naghiu
Esteemed Contributor

Re: identify the number of CPU on HPUX

Stm is part of Diagnostics. You have to install Diagnostics (now is called Support Puls cdrom) to be able to use stm
Rick Garland
Honored Contributor

Re: identify the number of CPU on HPUX

stm is the 'Systems Tools Manager' and can execute in character mode (cstm), motif mode (mstm), and X mode (xstm).

Is part of DIAGS