Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting Config 4

Status
Not open for further replies.

novawolf1

Technical User
May 7, 2003
10
US
Okay,

I have been tasked with getting information about HP and AIX systems without using SAM or SMIT. I will be writing my little utility in Perl. Basically I need a way to get everything about OS,Processor,Memory,Paging,and disks. I am familair with iostat,mount,swlist,uname and vmstat. I am hoping that there is a "CONFIG" like file somewhere that I can pull this info from.

I would even be happy to get the list of commands to find processor and memory info.

FYI: I have looked through the SAM and SMIT logs.... did not see ALL of the commands.

Please Help!!!
 
Here are some
1. 'model' will return the processor name; e.g. K570, D390, etc.

2. Match the output from 'uname -m' with /usr/sam/lib/mo/sched.models to find the PA-RISC version of your processor. /usr/sam/lib/mo/sched.models will be as current as your SAM patches.

3. 'getconf KERNEL_BITS' will return whether you are running 32- or 64-bit.

4. 'getconf HW_32_64_CAPABLE' will show whether your processor is 64-bit capable or not.

5. To find the processor speed (MHz):

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

adb is a debugger.

Here are some commands to verify system resources:
for HP-UX 10x
echo physmem/D | adb -k /stand/vmunix /dev/kmem
physmem:
physmem: 24576

for HP-UX 11.x systems running on 32 bit architecture:

echo phys_mem_pages/D | adb /stand/vmunix /dev/kmem
phys_mem_pages:
phys_mem_pages: 24576

for HP-UX 11.x systems running on 64 bit architecture:

echo phys_mem_pages/D | adb64 -k /stand/vmunix /dev/mem
phys_mem_pages:
phys_mem_pages: 262144

The results of these commands are in memory pages, multiply by 4096
to obtain the size in bytes.

To determine the amount of lockable memory:

echo total_lockable_mem/D | adb -k /stand/vmunix /dev/mem
total_lockable_mem:
total_lockable_mem: 185280

To determine the number of free swap pages :

echo swapspc_cnt/D | adb -k /stand/vmunix /dev/kmem
swapspc_cnt:
swapspc_cnt: 216447

This will display the number of free swap pages.
Multiply the number returned by 4096 for the number of free swap bytes.

To determine the processor speed:

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

OR
echo itick_per_tick/D | adb -k /stand/vmunix /dev/kmem | tail -n| awk '{print $2/10000 "MHz"}'

To determine the number of processors in use:

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

To determine the number of pages of buffer cache ( 4Kb in size)

echo bufpages/D | adb -k /stand/vmunix /dev/mem
bufpages:
bufpages: 18848

To display kernel parameters using adb use the parameter name :

echo nproc/D | adb -k /stand/vmunix /dev/mem
nproc:
nproc: 276

To determine the kernel your booted from:

10.x
echo 'boot_string/S' | adb /stand/vmunix /dev/mem
boot_string:
boot_string: disc(52.6.0;0)/stand/vmunix

11.x
echo 'boot_string/S' | adb /stand/vmunix /dev/mem
boot_string:
boot_string: disk(0/0/2/0.6.0.0.0.0.0;0)/stand/vmunix

To Check if system is 32bit or 64bit
getconf HW_CPU_SUPP_BITS and getconf KERNEL_BITS
 
On the HPUX system, if you haven't loaded "ignite" you may want to since it's free. Run a command: "/opt/ignite/bin/print_manifest" to print out your system's information. If you have fiber cards, use "/opt/fcms/bin/fcmsutil /dev/tdX" (X being the card slot, could be 0 or 1). Another handy command is "vgdisplay -v". Hope this helps.
 
novawolf, I have a script for AIX and HP that extracts all kinds of info about disks, important configuration files, etc. Post your email and I will send them to you.

You also might want to check the FAQ tab in the HP and AIX forums for other tips.
 
You guys rock!!!!!!!!!!!!!!!!!!!!!
Thank you so much for all of the tips!!!!!!!
 
@bi
I would be VERY interested in these scripts you have. I also write a software that collects configuration-data from various hp-ux and aix machines. These scripts would be very helpful to mee.

TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top