1829103 Members
2363 Online
109986 Solutions
New Discussion

shell

 
chin hyeon jung
Advisor

shell

I want to make shell which has following information
model k370
version 11.0
CPU xxxMhz , -2-EA running
MEM xxGB
HDD total xxxGB
internal xxxGB
external XXX GB
Used xxx GB
Could you help me?

5 REPLIES 5
Steven Sim Kok Leong
Honored Contributor

Re: shell

Hi,

I believe you are asking for shell scripts that will return you system configuration information as you listed.

Following link contains a number of useful scripts that perform what you require (look at bottom of page):

http://www.introcomp.co.uk/examples/

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: shell

Hi,

In particular, look at collect.sh. Other scripts are also available.

More information can also be found in the following thread:

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

Hope this helps. Regards.

Steven Sim Kok Leong
Michael Tully
Honored Contributor

Re: shell

Hi,

You can get most of this information from your ignite manifest file:

/var/opt/ignite/manifest/manifest

I have another script provided by HP that you could use. If you have a support contract I can provide it. Let me know.

Cheers
~Michael~
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: shell

Hi Chin,

I will provide half of the information. It's real simple..

#!/usr/bin/ksh
MODEL=`model|awk '{FS="/";print $3}'`
VER=`uname -r`
SPEED=`echo itick_per_tick/D | adb -k /stand/vmunix /dev/kmem | tail -1 |awk '{p
rint $2 / 10000}'`
MEM=`echo 'phys_mem_pages/D'| adb -k /stand/vmunix /dev/kmem | tail -1 |awk '{pr
intf ( "%.2f", $2 * 4096 / 1000000000 ) }'`
PROC=`echo 'processor_count/D' | adb -k /stand/vmunix /dev/kmem |tail -1 |awk '{
print $2}'`

echo MODEL: $MODEL
echo VERSION: $VER
echo CPU: $SPEED Mhz, - $PROC running
echo MEM: $MEM GB

About the disk information, I will give you some hints so that you can get it on your own.

1. Get the disks from ioscan -fnC disk
2. Do a diskinfo on each of the disk and add them all together to get total HDD
3. Do a vgdisplay and get the volume groups
4. For each volume group do a vgdisplay and get PE size, total PE Alloc PE.

total PE * Alloc PE gives you used disk.

It is difficult (but possible) to differentiate between internal and external disks.

You can use all the above scripts plus the above to get what you want.


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
John Strang
Regular Advisor

Re: shell

You could have a look at a script called
cfg2html - it creates ascii and html files containing details of system configuration, disk usage etc.

It is available at
http://members.tripod.com/rose_swe/cfg/cfg.html

HTH

John
If you never make a mistake you'll never make anything.