Thursday, May 2, 2013

Script to Check Memory Usage in AIX


#!/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 / 1000`
fm=`expr $tm - $um`
echo "\n\n-----------";
echo "System : (`hostname`)";
echo "-------\n\n";

echo "\n\n---------";
echo " Users Login information \n";

for ENTRY in `finger | cut -d " " -f1 | grep -v Login | uniq`
do
echo "`finger -l $ENTRY | head -1 | cut -d \" \" -f14` ---> `finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1`";
#finger -l $ENTRY | awk '{ print $2 }' | tail -2 | head -1;
done
echo "--------\n";

echo "\n-------";
echo "Memory Information\n\n"
echo "total memory = $tm MB"
echo "free memory = $fm MB"
echo "used memory = $um MB"
echo "\n\n-------\n"
****

Wednesday, May 1, 2013

How to analyze AIX Dumps


Analysing dump on AIX 6.1

First check if your system has produced the dump successfully
# sysdumpdev –L



You should see message as “dump completed successfully”

Then generate the snap with the command “snap –ac”

Once you have the snap completed, then move the snap to a directory where you have more free space to extract the snap.

Extract snap commands:
# uncompress snap.pax.Z
# pax -rvf snap.pax
# cd dump
# uncompress unix.Z
# dmpuncompress dump.BZ

To invoke the dump analysis run the below command in the same dir

# kdb dump unix


Read the perfpmr trace files

Search for the FMT file under the perfpmr directory and locate the path since you need to use it for analysis