Operating System - HP-UX
1758616 Members
1802 Online
108874 Solutions
New Discussion юеВ

To find the CPU frequency on HP-UX11.00

 
Jessica_37
Occasional Contributor

To find the CPU frequency on HP-UX11.00

I am only a regular user on HP-UX, I double check that I can not use "SysInfo" or "dmesg" because permission denied. And in syslog can not find CPU information, plus try to use "Glance Plus" and no such info available in "CPU report".

Anyone can help me to find the CPU frequency using a regular user account?

Thanks a lot
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: To find the CPU frequency on HP-UX11.00

Jessica,

Check this thread from Nancy Rippey:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=851889


Pete

Pete
Peter Godron
Honored Contributor

Re: To find the CPU frequency on HP-UX11.00

Jessica,
if nobody else comes up with a better solution, ask your friendly System Administrator to tell you.
Or, as somebody else has posted:
perl -e 'local($PSTAT, $PSTAT_PROCESSOR)=(239,10);
local($struct_pst_processor)=("L30");
local($cpu_info, $cpu_ticks);
$cpu_info = "\0" x 120;
syscall($PSTAT, $PSTAT_PROCESSOR, $cpu_info, length($cpu_info), 1, 0);
($cpu_ticks)=(unpack($struct_pst_processor, $cpu_info))[26];
print "speed=".int($cpu_ticks/10000)."\n";'
Ninad_1
Honored Contributor

Re: To find the CPU frequency on HP-UX11.00

Jessica,

Try
echo "selclass type cpu;info;wait;infolog" | /usr/sbin/cstm

Tou will get an output which will show you the CPU type
PA8200 or PA8500 or PA8600 ... PA8900.
Depending on the CPU type and server model -
can get using command
model

You can understand the CPU freq.
e.g. PA8500 - 440 MHz
PA8700 - 750 MHz
PA8900 - 1 or 1.1 GHZ etc
you can search on web once you get the CPU type and server model.

Hope this helps,
Ninad
dean licheri_1
New Member

Re: To find the CPU frequency on HP-UX11.00

Hi

copy script into a file chmod to 755 and run it. it will give a whole bunch of usefull info.

regards
dean

-----------------------snip------------------
#!/usr/bin/ksh

if [ `uname -s` != "HP-UX" ]; then
echo "Incompatible kernel, script is HP-UX specific; exiting"
exit 1
fi
VER=`uname -r | cut -c3-4`
case $VER in
"09") KERNEL="/hp-ux" ;;
"10"|"11") KERNEL="/stand/vmunix" ;;
*) echo "HP-UX version $VER not supported"
exit 2 ;;
esac
# Check that /dev/mem is readable
if [ ! -r /dev/mem ]; then
echo "/dev/mem read access denied"
exit 3
fi
# determine page size
eval $(grep "define *PAGESIZE" /usr/include/limits.h |
sed 's/# *define *//;s/ /=/;s/ *//g')
if [ "$PAGESIZE" = "" ]; then
echo "PAGESIZE not explicitly defined; assuming 4096"
PAGESIZE=4096
fi
# echo $PAGESIZE
# start adb
adb -k $KERNEL /dev/mem |&
# get kernel data
alias setvar='read -p title ; read -p resp ; eval $(echo $resp | sed "s/: */=/")'
print -p hostname/s ; setvar
print -p pdc_model_string/s ; setvar
print -p processor_count/D ; setvar
print -p ;
CLOCK=`echo itick_per_tick /D | adb /stand/vmunix /dev/kmem |grep itick_per_tick:| tail -1| awk '{print $2/10000 "
MHz"}'`
print -p itick_per_tick/D ; setvar
if [ "$VER" -eq "10" ] ; then
export MEM=`echo physmem/D | adb /stand/vmunix /dev/kmem |tail -1| awk '{print $2/256 " Mb"}'`
elif [ $VER -eq "11" ]; then
export MEM=`/usr/sbin/dmesg | grep "Physical:" | awk '{ substr($0,","," "); print $2/1000 " Mb" }'`
else
echo Memory calculation complete
fi
# display results
echo "Hostname\t\t= $hostname"
echo "Model\t\t\t= $pdc_model_string"
echo "OS Release Level\t= `uname -r`"
echo "Processor Count\t\t= $processor_count"
echo "Clock Speed\t\t= ${CLOCK}"
echo "Main Memory \t\t= ${MEM}"
# kill off adb & exit
print -p '$q'
exit 0
--------------------end ----------------------
erics_1
Honored Contributor

Re: To find the CPU frequency on HP-UX11.00

Type in the command 'model'. You'll get the model string of the system. The last two numbers will give the cpu size. For example:

$ model
9000/800/L2000-44

This system has 440mhz cpu's.

Regards,
Eric
Jessica_37
Occasional Contributor

Re: To find the CPU frequency on HP-UX11.00

Thanks everyone for the excellent answers. Eric, thanks very stright forward answer.
Josiah Henline
Valued Contributor

Re: To find the CPU frequency on HP-UX11.00

Simply running "model" is never an accurate way to check for the processor speed. The information that is retrieved from the "model" command is dependant on someone to have entered it correctly at some point.

To query the system you can use "adb". It is an accurate way to pull the information from a system's kernel.

echo "itick_per_usec/D" \
|adb -k /stand/vmunix /dev/kmem \
|tail -1 \
|awk '{ print $2 , "\bMhz" }'
If at first you don't succeed, read the man page.
Josiah Henline
Valued Contributor

Re: To find the CPU frequency on HP-UX11.00

Jessica,

That information can only be verified by someone with root privledges.

Regards,
Josiah
If at first you don't succeed, read the man page.