Академический Документы
Профессиональный Документы
Культура Документы
Check_for_Root ()
{
id | grep root 1>&2 > /dev/null
if [ $? -ne 0 ]
then
echo "You must be root to run this!"
exit
fi
} # Check_for_Root
adb_calls ()
{
cd $PDIR/$DIR
date >> $ADB
echo "\nLotsfree" >> $ADB
echo "lotsfree/K" | adb -k >> $ADB
echo "lotsfree/D" | adb -k >> $ADB
echo "lotsfree/E" | adb -k >>$ADB
echo "\nMinfree" >> $ADB
echo "minfree/D" | adb -k >> $ADB
echo "minfree/K" | adb -k >> $ADB
echo "minfree/E" | adb -k >>$ADB
echo "\nAvefree" >> $ADB
echo "avefree/K" | adb -k >> $ADB
echo "avefree/D" | adb -k >> $ADB
echo "avefree/E" | adb -k >>$ADB
echo "\nFreemem" >> $ADB
echo "freemem/D" | adb -k >> $ADB
echo "freemem/K" | adb -k >> $ADB
echo "freemem/E" | adb -k >>$ADB
echo "\nAvefree30" >> $ADB
echo "avefree30/D" | adb -k >> $ADB
echo "avefree30/E" | adb -k >> $ADB
echo "avefree30/K" | adb -k >>$ADB
echo "\nK_anoninfo" >> $ADB
echo "k_anoninfo/D" | adb -k >> $ADB
echo "k_anoninfo/E" | adb -k >>$ADB
echo "k_anoninfo/K" | adb -k >>$ADB
} # adb_calls
Iterations ()
{
echo ""
echo "Please enter the number of ITERATIONS that need to be done."
echo "If you have not been given instructions for this number,"
echo "enter 5."
read COUNT
}
Seconds ()
{
echo ""
echo "Please enter the NUMBER of SECONDS to wait between each iteration.
"
echo "If you have not been given instructions for this number,"
echo "enter 300"
read INTERVAL
}
Case_Number ()
{
echo ""
echo "Please enter your case number."
echo "The case number should only consist of digits."
read CASE
}
Create_Directories ()
{
cd $PDIR
if [ -r $DIR ]
then
rm -rf $DIR
fi
touch $IOSTAT
if [ $? -ne 0 ]
then
echo "The file $IOSTAT could not be created."
exit 1
fi
echo ""
echo "\tCreated the $IOSTAT file."
touch $UPTIME
if [ $? -ne 0 ]
then
echo "The file $UPTIME could not be created."
exit 1
fi
uptime 1>> $UPTIME 2> /dev/null
echo "\tCreated the $UPTIME file."
touch $SARQ
if [ $? -ne 0 ]
then
echo "The file $SARQ could not be created."
exit 1
fi
echo "\tCreated the $SARQ file."
touch $IPCS
if [ $? -ne 0 ]
then
echo "The file $IPCS could not be created."
exit 1
fi
echo "\tCreated the $IPCS file."
touch $KMASTAT
if [ $? -ne 0 ]
then
echo "The file $KMASTAT could not be created."
exit 1
fi
echo "\tCreated the $KMASTAT file."
touch $IOSTATXPN
if [ $? -ne 0 ]
then
echo "The file $IOSTATXPN could not be created."
exit 1
fi
echo "\tCreated the $IOSTATXPN file."
touch $MPSTAT
if [ $? -ne 0 ]
then
echo "The file $MPSTAT could not be created."
exit 1
fi
echo "\tCreated the $MPSTAT file."
touch $VMSTATP
if [ $? -ne 0 ]
then
echo "The file $VMSTATP could not be created."
exit 1
fi
echo "\tCreated the $VMSTATP file."
touch $VMSTAT
if [ $? -ne 0 ]
then
echo "The file $VMSTAT could not be created."
exit 1
fi
echo "\tCreated the $VMSTAT file."
touch $VMSTATI
if [ $? -ne 0 ]
then
echo "The file $VMSTATI could not be created."
exit 1
fi
echo "\tCreated the $VMSTATI file."
touch $PS
if [ $? -ne 0 ]
then
echo "The file $PS could not be created."
exit 1
fi
echo "\tCreated the $PS file."
touch $PSA
if [ $? -ne 0 ]
then
echo "The file $PSA could not be created."
exit 1
fi
echo "\tCreated the $PSA file."
touch $NFSSTAT
if [ $? -ne 0 ]
then
echo "The file $NFSSTAT could not be created."
exit 1
fi
echo "\tCreated the $NFSSTAT file."
touch $MOD
if [ $? -ne 0 ]
then
echo "The file $MOD could not be created."
exit 1
fi
echo "\tCreated the $MOD file."
touch $LOCKSTAT
if [ $? -ne 0 ]
then
echo "The file $LOCKSTAT could not be created."
exit 1
fi
echo "\tCreated the $LOCKSTAT file."
touch $ADB
if [ $? -ne 0 ]
then
echo "The file $ADB could not be created."
exit 1
fi
echo "\tCreated the $ADB file."
} # Create_Directories
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
bad=1
while [ $bad -ne 0 ]
do
Seconds
if [ "$INTERVAL" -gt 0 ]
then
echo "INTERVAL is $INTERVAL"
else
echo "bad: Invalid Number"
fi 2>&1 | grep -c bad | read bad
done
echo
echo "\n\n"
echo ""
Create_Directories
echo ""
echo ""
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
# Launch the iostat, mpstat, and vmstat commands that don't need
# to be in a loop
LOOP=1
LAST=$COUNT+1
while [ ${LOOP} -lt ${LAST} ]
do
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
# Wait for all processes to finish
echo
echo
wait $PID1
wait $PID2
wait $PID3
wait $PID4
wait $PID5
wait $PID6
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
echo ""
echo "Making a uuencoded, compressed tarball."
cd $PDIR/${DIR}
tar -cf ${FILE} *
compress $FILE
uuencode $FILE.Z $CASE.perf.tar.Z > $FILE.Z.uu
chmod 777 $FILE.Z.uu
#####################################################################33
#####################################################################33
#####################################################################33
#####################################################################33
echo "\n\n\n"
echo "Please give the data to your support engineer."
echo "The data is stored in the file $FILE.Z.uu"
echo "- You can email the data or ftp it."
echo "- Distinguish the data as from a busy time or idle time by adding"
echo " the words busy or idle to the file name."
echo "\n\n\n"
echo "Instructions for emailing the data"
echo "\tPut the case number, $CASE, in the subject line of the email."
echo "\tSend a .uu version of the data. This is uuencoded and "
echo "\tsurrives email better."
echo "\n\n\n"
echo "Instructions for uploading a file to SunSolve."
echo "\tftp sunsolve.sun.com"
echo "\t(192.18.99.148)"
echo "\tlogin: anonymous"
echo "\tpasswd: your email address"
echo "\tcd /cores"
echo "\tbinary"
echo "\tput $FILE"
echo "\tquit"
echo "\tThen please call your support engineer or send them an email"
echo "\tand notify them that the data is on sunsolve."
echo "\tYou can reach your support engineer by phone by calling"
echo "\t1800usa4sun, hitting 1, hitting 1, then dialing $CASE"