Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web


Custom Page
  About Me | Favorite Links | Smile Please | Old Madras Pics | UK_Photos | USA_Photos | Auto E-mailer | Reach me | findmem - Shell Script | Donate for findmem | Catalog Page | Home Sweet Home  

If you would like to have a working copy of the findmem given below, please mail to param_m23@yahoo.com













  Here is the findmem script ...
I am sorry for the alignment
If you want a working copy , please pay and get it.

#! /sbin/sh

###############################################################################
# #
# F I N D M E M V E R S I O N 1.6.1 #
# #
###############################################################################
#
#
# Created on 25/04/2000 By Param Krish. Tested and Found
# working in SS2, SS4, Ultra 1,2,5,10, E250,450,3500. This Script is available
# as Freeware-Open Source from the website directly
#
# This Scripts tells the Memory Modules occupied in the Memory banks.
# Download the script and execute as ./findmem.
#
# Please check the End of each line whether any ESC characters are added..
# if so, please delete before running.
#
# This script looks into the output of the command "/usr/sbin/prtconf -pv" and
# interprets the Hexadecimal value of memory in Decimal.
#
#
#################################################################
# #
# S C R I P T S T A R T S H E R E #
# #
#################################################################


Version()
{
cat << EOF
Findmem Utility Version 2.0.1. Tested in SS10, Ultra1,2,5,10. Enterprise 250,450,3000,3500
EOF
}

counter()
{
count=`cat /tmp/memfind7 | wc -l`
while [ "" -ge 1 ]
do
echo "BANK\t\c"
newcount=`expr + 1`
count=`expr - 1`
done
echo
}


FAQ()
{
clear
cat << EOF

#############################################################################

FREQUENTLY ASKED QUESTIONS

#############################################################################


1) Script, when executed shows

= 8192 Megabytes

What does it mean?


This means, You machine is currently running with only one Module,
and the value of the module is the total memory.(i.e.8192 MB)


2) What is needed to run this script and how to run ?

s scoipt is designed for Solaris Opearating system only. So, it can
be run in any Solaris Version(e.g Solaris 2.6,2.7,2.8). Copy the file
into /usr/sbin. So that, this script will become a unix command,
everyone can use the script as a normal command.

3) What is the use of this script?

This script looks into the output of prtconf -pv command and
converts the Hexadecimal Value into the Decimal Value and gives
a user friendly information, so that even a Enduser can understand
how much is memory in the machine. This is especially designed for
Server range Sun machines, which may not be shutdown just for knowing
the Memory Information, which can be used for Memory upgrades.
When you got the information about the memory availability of your
machine from this script,
Say, if your machine has

256MB 256MB 256MB = 768Megabytes.




EOF
echo " Press a Key to continue ... "
read key
clear
cat << EOF



It means, Your system is occupied with 3banks(Each with 256MB).
Please refer to your System Field Engineers Manual, to know about the
No.of Memory Slots in your machine.
For Ultra Range machines, Each Mem.Bank refers to one Mem.Slot. It
means, your system has 8Slots and 3 are occupied with 3 Mem.modules.
You still have 5 more slots free, and can be upgraded as you wish.
Hope, this would be clear about this script.

4) While running the script, gives out so many errors, What to do?

Please Check the Script, whether it has any special characters, or
While downloading the script from Dos/Windows to UNIX, there may be
some problem in the End of Line of each & every line. Please Check
each & every line of the script, and make sure, it is properly
terminated.

5) Script, when executed, gives output like

256MB 256MB 256MB = 768Megabytes

What does it mean?

It means, your system has 3 Memory Banks occupied with 256MB modules.
Please Check your Field Engineer Manual. As per the system model,
classified as Ultra 10, 20..80, E250, E450..etc, the no.of banks
will be mentioned in the manual.
If your model has 8 Slots, and 2 slots refers to a Memory Bank, Then,
your system is occupied with 256MB in each Mem.bank(i.e. 2 X 128MB
Memory modules), and so, 6slots are occupied. So,Now, you have only 2
more slots free for Memory Upgrade.

EOF




echo "Press a key to continue ..."
read key
clear
cat << EOF



##############################################################################

Feedback:

Please Do not forget to drop a mail to the below address, which is highly
appreciated.


############################################################
# #
# Any Suggestions, Queries: #
# ------------------------- #
# #
# Contact : #
# #
# Param Krish #
# Senior Systems Engineer #
# TOSS Software Inc., #
# Fremont, California, #
# United States of America #
# Email: toss_software@yahoo.com #
# #
############################################################

EOF
}


fieldsep2()
{
sed -e 's/reg://g' /tmp/memfind2
sed -e 's/ //g' /tmp/memfind3
sed -e 's/\.//g' /tmp/memfind4
fold -w 8 /tmp/memfind4 >/tmp/memfind5
nl -nln /tmp/memfind5 >/tmp/memfind6
touch /tmp/memfind7
> /tmp/memfind7
k=4
var=` cat /tmp/memfind6 | wc -l `
while [ "" -le "" ]
do
grep "^" /tmp/memfind6|cut -f2 >>/tmp/memfind7
k=` expr + 4 `
done
}

fieldsep()
{
sed -e 's/reg://g' /tmp/memfind2
sed -e 's/ //g' /tmp/memfind3
fold -w 8 /tmp/memfind4 >/tmp/memfind5
nl -nln /tmp/memfind5 >/tmp/memfind6
touch /tmp/memfind7
>/tmp/memfind7
k=3
var=` cat /tmp/memfind6 | wc -l `
while [ "" -le "" ]
do
grep "^" /tmp/memfind6|cut -f2 >>/tmp/memfind7
k=` expr + 3 `
done
}

sun4c()
{
cat /tmp/memfind | tail - | head -1>/tmp/memfind1

if [ `cat /tmp/memfind1 | awk -F" " '{print '` = "#size-cells:" ]
then
cat /tmp/memfind | tail - | head -1 >/tmp/memfind1
fi

if [ `cat /tmp/memfind1 | awk -F" " '{print '` != "reg:" ]
then
tput bold
echo "Findmem Utility fails.,Please Contact Parameswaran-Wipro, Email: param.krish@wipro.com"
tput rmso
exit
fi
fieldsep
echo "\nBankwise Memory Modules...."
echo "\n\t\c"
count=`cat /tmp/memfind7 | wc -l`
echo "The Machine has Memory Bank(s) filled with the "
echo "following breakup."
echo
echo "MEMORY BREAKUP:"
echo

for i in `cat /tmp/memfind7`
do
tput bold
case in
00400000) echo "4MB\t\c";
;;
00800000) echo "8MB\t\c";
;;
01000000) echo "16MB\t\c";
;;
02000000) echo "32MB\t\c";
;;
03000000) echo "48MB\t\c";
;;
04000000) echo "64MB\t\c";
;;
08000000) echo "128MB\t\c";
;;
10000000) echo "256MB\t\c";
;;
20000000) echo "512MB\t\c";
;;
40000000) echo "1024MB\t\c";
;;
80000000) echo "2048MB\t\c";
;;
esac
done
mo=`/usr/sbin/prtconf | head -2 |tail -1 |awk -F" " '{print '`
echo " = Megabytes"
tput rmso
echo
echo
echo
echo " Please Check the Hardware manual for `cat /tmp/memfind.out` to know the "
echo " No. of Memory slots = 1 Memory Bank."
echo
#rm /tmp/memfind*
echo
}


sun4m()
{
cat /tmp/memfind | tail - | head -1 >/tmp/memfind1

if [ `cat /tmp/memfind1 | awk -F" " '{print '` = "#size-cells:" ]
then
cat /tmp/memfind | tail - | head -1>/tmp/memfind1
fi

if [ `cat /tmp/memfind1 | awk -F" " '{print '` != "reg:" ]
then
tput bold
echo "Findmem fails..., Please Contact Parameswaran-Wipro, Email: param.krish@wipro.com"
tput rmso
exit
fi
fieldsep
echo "\nBankwise Memory Modules...."
echo "\n\t\c"
count=`cat /tmp/memfind7 | wc -l`
echo "The Machine has Memory Bank(s) filled with the "
echo "following breakup."
echo
echo "MEMORY BREAKUP:"
echo

for i in `cat /tmp/memfind7`
do
tput bold
case in
00400000) echo "4MB\t\c";
;;
00800000) echo "8MB\t\c";
;;
01000000) echo "16MB\t\c";
;;
02000000) echo "32MB\t\c";
;;
03000000) echo "48MB\t\c";
;;
04000000) echo "64MB\t\c";
;;
08000000) echo "128MB\t\c";
;;
10000000) echo "256MB\t\c";
;;
20000000) echo "512MB\t\c";
;;
40000000) echo "1024MB\t\c";
;;
80000000) echo "2048MB\t\c";
;;
esac
done
mo=`/usr/sbin/prtconf | head -2 |tail -1 |awk -F" " '{print '`
echo " = Megabytes"
tput rmso
echo
echo
echo
echo " Please Check the Hardware manual for `cat /tmp/memfind.out` to know the "
echo " No. of Memory slots = 1 Memory Bank."
echo
#rm /tmp/memfind*
echo
}


ultra()
{

cat /tmp/memfind | tail - | head -1>/tmp/memfind1

if [ `cat /tmp/memfind1 | awk -F" " '{print '` = " #size-cells:" ]
then
cat /tmp/memfind | tail - | head -1>/tmp/memfind1
fi
if [ `cat /tmp/memfind1 | awk -F" " '{print '` != "reg:" ]
then
tput bold
echo "Findmem fails..., Please Contact Parameswaran-Wipro, Email: param.krish@wipro.com "
tput rmso
exit
fi

fieldsep2

echo "\nBankwise Memory Modules...."
echo "\n\t\c"
count=`cat /tmp/memfind7 | wc -l`
echo "The Machine has Memory Bank(s) filled with the "
echo "following breakup."
echo
echo "MEMORY BREAKUP:"
echo
counter
for i in `cat /tmp/memfind7`
do
tput bold
case in
00400000) echo "4MB\t\c";
;;
00800000) echo "8MB\t\c";
;;
01000000) echo "16MB\t\c";
;;
02000000) echo "32MB\t\c";
;;
04000000) echo "64MB\t\c";
;;
08000000) echo "128MB\t\c";
;;
10000000) echo "256MB\t\c";
;;
20000000) echo "512MB\t\c";
;;
40000000) echo "1024MB\t\c";
;;
80000000) echo "2048MB\t\c";
;;
esac

done
mo=`/usr/sbin/prtconf | head -2 |tail -1 |awk -F" " '{print '`
echo " = Megabytes"
tput rmso
echo
echo
echo
echo " Please Check the Hardware manual for `cat /tmp/memfind.out` to know the "
echo " No. of Memory slots = 1 Memory Bank."
echo
#rm /tmp/memfind*
echo
}

#start()
#{


newcount=1
case "$1" in
'-detect' | '-d') continue;
;;
'-V' | '-v') Version
exit 1
;;
'-suggest') echo "Under Construction"
exit 1
;;
'-?' | '-help') echo "Help Screen is this much only as of now"
exit 1
;;
'-faq') FAQ
exit 1
;;
*)

cat << EOF

Usage : findmem

parameters : [-detect] [-V] [-v] [-?] [-suggest] [-help]

-detect : Detects the Memory breakup
-suggest : Suggests the Feasibility of Memory Upgrade possible with the current model
-help (or) -? : Displays Help screen
-faq : Displays FAQ of findmem utility
-V (or) -v : Version of findmem

EOF
exit 1
;;
esac


clear
echo "Please Wait !!! ..."
echo
/usr/sbin/prtconf -pv | grep -i banner-name | head -1 | cut -f2 -d : | awk -F\' '{print ' > /tmp/memfind.out
echo "Hardware Detected : `cat /tmp/memfind.out` "
echo
/usr/sbin/prtconf -pv > /tmp/memfind
var1=`cat /tmp/memfind | wc -l `
var2=`cat /tmp/memfind | grep -n "\'memory\'" | awk -F: '{print '`
var3=`expr - 3`
var4=`expr - `
var5=`expr + 1`
case `uname -m` in
sun4m | sun4d) sun4m ;
;;
sun4u) ultra;
;;
sun4c) sun4c;
;;
esac



#################################################################
# #
# S C R I P T E N D S H E R E #
# #
#################################################################

Click below image to pay through PayPal

Click Here :: Pay through Yahoo! PayDirect to get a working copy of 'findmem'


Yahoo! PayDirect