Wednesday 26 February 2014

Performance - Memory Calculator

#!/usr/bin/ksh
#memory calculator
um=`svmon -G | head -2|tail -1| awk {'print $3'}`
um=`expr $um / 256`
tm=`lsattr -El sys0 -a realmem | awk {'print $2'}`
tm=`expr $tm / 1024`
fm=`svmon -G | head -2|tail -1| awk {'print $4'}`
fm=`expr $fm / 256`
umorg=`vmstat|tail -1|awk '{print $3}'`
umorg=`expr $umorg / 256`
bc=`expr $um - $umorg`

echo "\n\n-----------------------";
echo "System : (`hostname`)";
echo " "
echo "Paging Space details"
lsps -s
echo "-----------------------\n\n";
echo "Memory Information\n\n";
echo "total memory = $tm MB"
echo "free memory = $fm MB"
echo "used memory = $umorg MB"
echo "Buffer cache = $bc MB"
ump=`expr  $umorg \* 100 / $tm `
echo "Used Memmory in % = $ump %"

echo "\n\n-----------------------\n";

No comments:

Post a Comment