SUMMARY: Script to find out size of memory modules...

omkumar (omkumar@india.ti.com)
Wed, 24 Sep 1997 10:10:26 -0500

--Boundary_(ID_JFXVOCrd6KMQcnAlxFFbZQ)
Content-type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=text
Content-description: text
Content-disposition: ATTACHMENT; FILENAME=text
X-Sun-Charset: us-ascii

Hi,
Thankyou once again for our kind help....
Thanks to

Jens Fischer
Jim Harmon
Matthew Reynolds
brion@dia.state.ma.us
howie@warlok.ds.boeing.com
Virginia.Coffindaffer@wang.com
chopin@sgh.waw.pl

All the scripts are working perfectly for SOlaris.
For Sunos, some of you had suggested to use "/usr/diag/sundiag/pmem v"
But If there is a script which uses /usr/etc/devinfo -pv. It will be
good.
Thanks once again.

--Boundary_(ID_JFXVOCrd6KMQcnAlxFFbZQ)
Content-type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=get_mem_conf
Content-description: default
Content-disposition: ATTACHMENT; FILENAME=get_mem_conf
X-Sun-Charset: us-ascii
X-Sun-Data-type: default-app

#!/usr/bin/ksh
/usr/sbin/prtconf -pv | grep -v translations > /tmp/prtconf.tmp
type=`grep banner-name /tmp/prtconf.tmp |
sed -e 's/.*'\''\(.*\)'\''/\1/'`

ss20=false
case "$type" in
"Sun Ultra"*)
groups=4
;;
"SPARCstation 20"*)
groups=3
ss20=true
;;
"SPARCstation LX"*)
groups=3
;;
"SPARCstation 5"*)
groups=3
;;
"") # IPX shows no banner name, don't no about other sun4c machines
groups=3
;;
default)
echo "unknown machine type $banner-name for $var"
;;
esac

# for debugging:
# echo "$type $groups"
# echo $reg

banks=`awk '
BEGIN { groups='$groups' }
/reg:/ {reg=$2}
/name:.*'\''memory'\''/ {
nreg=split(reg,regar,".")
for(i=groups;i<=nreg;i+=groups) print substr(regar[i],1,3)
}' /tmp/prtconf.tmp | (echo 'ibase=16';cat) | bc`

if [ $ss20 = true ]
then
echo $banks | awk '{for(i=1;i<=NF;i++) printf("%5s",$i)} END {print}' |
sed -e 's/16 16/32/g'
else
echo $banks | awk '{for(i=1;i<=NF;i++) printf("%5s",$i)} END {print}'
fi
#rm /tmp/prtconf.tmp

--Boundary_(ID_JFXVOCrd6KMQcnAlxFFbZQ)--