Hi,
If memory serve me well, you should try dmesg. At least for CPU info.
Main Topics
Browse All TopicsDear experts,
I would like to know as a regular unix user, how what commands can get the information of HP-UX system
CPU clock speed (in MHz or GHz),
memory size (in MB or GB),
swap size (in MB or GB),
hard disk volume (in GB, not filesystem size)
System model (Such as J6700)
System Serial number (if possible)
I want to put those commands into a script so end users can run it to get the information for the HP-UX they are login.
As root, I can get those information and I would like to know the commands for regular user.
Most important information is the CPU speed, physical memory size, swap size, and disk volume.
Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Could you try with getconf ? It works for non root users.
eg.; getconf CPU_CHIP_TYPE
Unfortunatelly, the output is not very user friendly... See the man page for the list of available infos.
At the following address, you will find a script to show you how to determine the CPU -> http://unix.derkeiler.com/
Other command you can also use are:
- model -> gives the model of your server
- lsdev -> list device driver in the system
- ioscan -> Won't work as non root -> scan I/O system and output a map
The last way that I can think of would be to extract the informations from /var/adm/syslog/syslog.log
I hope it helps.
From the following site http://forums1.itrc.hp.com
Could you try this:
echo $(echo itick_per_tick/D | adb -k /stand/vmunix /dev/kmem | tail -1 | awk '{print $2/10000}')
I can't try it at the moment, so I'm not sure if it will run as non root user, especially since we access the kernel...
Ok, I got it now !
I wrote a small C program to obtain the numbers of CPU and the speed. You just need to compile it!
I only tested it under 11.11. I have not use pstat() since it is deprecated, but if your version is too old for this program, you should be able to modify it quite easilly by looking at pstat()'s man page.
------8<------
#include <sys/param.h>
#include <sys/pstat.h>
int main()
{
struct pst_dynamic psd;
int num_cpus = 0;
struct pst_processor psp;
int clock = 0;
/* Determine how many processors are online and available */
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) != -1)
num_cpus = psd.psd_proc_cnt;
/* Report the speed of the first processor */
if (pstat_getprocessor(&psp, sizeof(psp),1,0)) {
clock = psp.psp_iticksperclktick / 10000;
}
printf("There is %d CPU(s) running at %d Mhz\n", num_cpus, clock);
}
------>8------
This program works great for me.
I just wonder whether there is the similar system commands/scripts in HP-UX like
/usr/sbin/prtconf in IBM AIX
or
/usr/platform/`uname -m`/sbin/prtdiag in Sun Solaris
or
/usr/sbin/dmidecode in Linux
(/usr/share/rhn/up2date_cl
By the way, besides "/usr/sbin/swapinfo" (root only) or /var/adm/syslog/syslog.log
To find out what AIX or Solaris is on HP-UX or on Linux or on whatever Unix you're using, just go to -> http://bhami.com/rosetta.h
For the swap as non root user here is another small C program... You can have a look at all the info you can get with man pstat
------8<------
#include <sys/param.h>
#include <sys/pstat.h>
int main()
{
struct pst_swapinfo pss;
unsigned long swapsize = 0;
unsigned long swapfree = 0;
int i = 0;
for (i = 0; pstat_getswap(&pss, sizeof(pss), (size_t)1, i); i++) {
swapsize += pss.pss_nblksenabled;
swapfree += pss.pss_nfpgs * 4;
}
printf("Swap size is %d (%d free)\n", swapsize, swapfree);
}
------>8------
Business Accounts
Answer for Membership
by: wesly_chenPosted on 2006-06-28 at 11:04:46ID: 17003483
I got the C program to get the physical memory size and compiled it for regular users. p/hpux-faq /section-2 84.html
http://www.faqs.org/faqs/h