A quick translation in ENGLISH.
Sorry for the spelling.
#!/usr/bin/ksh
#********************************
# performances AIX
#********************************
# variables
Total=0
#
clear
echo "***************************************"
echo "MAIN"
echo "0: freeware nom64"
echo "1: topas"
echo "2: vmstat 1 10"
echo "******************"
echo "MEMORY"
echo "3: SIZE OF THE RAM"
echo "4: SIZE OF THE paging space"
echo "5: % paging space"
echo "6: SIZE OF THE RAM used by all proces"
#echo "7: memoire occupe par tous les processus"
#echo "8: memoire occupe par oracle"
#echo "9: memoire occupe par les processus d'un utilisateur"
echo "10: SIZE OF THE RAM by ALL the PROCESS than are inclued in a string of caracter "
#echo "11: memoire occupe les processus d'un utilisateur identifie par une string de caractere"
echo "12: MEMORY DETAILS for the process of an user"
echo "******************"
echo "CPU"
echo "13: nomber of CPUs"
echo "14: type and frequency "
echo "******************"
echo "DISKS"
echo "15: statistics"
echo "16: start of statistics"
echo "17: stop of statistics"
echo "******************"
echo "VG et LV"
echo "18: statistics VG"
echo "19: statistics LV"
echo "20: start of statistics VG"
echo "21: stop of statistics VG"
echo "***************************************"
read REPONSE
case $REPONSE in
0)
echo ""
/usr/sbin/chdev -l sys0 -a iostat=true
echo "press enter when you are ready"
echo "press q to quit"
read
/sma/sys/bin/nmon64
/usr/sbin/chdev -l sys0 -a iostat=false
;;
1)
echo ""
echo "press enter when you are ready"
echo "press q to quit"
read
topas
;;
2)
echo ""
vmstat 1 10
;;
3)
echo ""
echo "size of the RAM"
RAM=`lsattr -El mem0 | grep Total |awk '{print $2}'`
echo " $RAM Mb"
;;
4)
echo ""
echo "size of the paging space"
PAGING=`lsps -a | grep -v Auto | awk '{print $4}'`
echo " $PAGING"
;;
5)
echo ""
echo "% paging space"
PAGING=`lsps -a | grep -v Auto | awk '{print $5}'`
echo " $PAGING %"
;;
6)
echo ""
echo "RAM occuped by all proces"
ps auwwx | grep -v defunct | grep -v COMMAND| awk '{print $6}' | while read line
do
Size=`echo $line`
if [ ! -z "$Size" -a "$Size" -ge 0 ]
then
((Total=Size+Total))
fi
done
printf "%30s\t\t%-d %s\n" Total $Total kilobytes
;;
7)
echo ""
echo "MEMORY used by all process"
ps auwwx | grep -v defunct | grep -v COMMAND| awk '{print $5}' | while read line
do
Size=`echo $line`
if [ ! -z "$Size" -a "$Size" -ge 0 ]
then
((Total=Size+Total))
fi
done
printf "%30s\t\t%-d %s\n" Total $Total kilobytes
;;
8)
echo ""
echo "memory used by oracle"
ps -f -l -u oracle | grep -v defunct | grep -v WCHAN| awk '{print $10}' | while read line
do
Size=`echo $line`
((Total=Size+Total))
done
printf "%30s\t\t%-d %s\n" Total $Total kilobytes
;;
9)
echo ""
echo "name of the user"
echo "after press enter"
read USER
echo ""
echo "memoire occupe par les processus de utilisateur $USER"
ps -f -l -u $USER | grep -v defunct | grep -v WCHAN| awk '{print $10}' | while read line
do
Size=`echo $line`
((Total=Size+Total))
done
printf "%30s\t\t%-d %s\n" Total $Total kilobytes
;;
10)
echo ""
echo " string of caracter"
echo "after press enter"
read STRING
echo ""
echo "RAM occuped by procesidentified by a string of caracter $STRING"
ps auwwx | grep -v defunct | grep $STRING| awk '{print $6}' | while read line
do
Size=`echo $line`
if [ ! -z "$Size" -a "$Size" -ge 0 ]
then
((Total=Size+Total))
fi
done
printf "%30s\t\t%-d %s\n" Total $Total kilobytes
;;
11)
echo ""
echo "enter the name of the user"
echo "press enter"
read USER
echo ""
echo "string of caracter"
echo "press enter"
read STRING
echo ""
echo "memory used by process of user $USER identified by string $STRING"
ps -f -l -u $USER | grep -v defunct | grep -v WCHAN| grep $STRING |awk '{print $10}' | while read lin
e
do
Size=`echo $line`
((Total=Size+Total))
done
printf "%30s\t\t%-d %s\n" Total $Total kilobytes
;;
12)
echo ""
echo "enter the name of the user"
echo "press enter"
read USER
echo ""
svmon -d -U $USER | more
;;
13)
echo ""
CPU=`lsdev -C | grep proc | grep -v grep | grep Available | wc -l`
echo "number of CPUs avalaible is $CPU"
;;
14)
echo ""
numProc=$(lsdev -C | grep proc | awk '{print $1}')
uniProc=`echo $numProc | awk '{print $1}'`
TYPE=`lsattr -El $uniProc | grep type | awk '{print $2}'`
echo "type of CPU is $TYPE"
FREQ=`lsattr -El $uniProc | grep freq | awk '{print $2}'`
echo "frequency of CPU is $FREQ Hz"
;;
15)
echo ""
iostat -s
;;
16)
echo ""
chdev -l sys0 -a iostat=false
chdev -l sys0 -a iostat=true
;;
17)
echo ""
chdev -l sys0 -a iostat=false
;;
18)
echo ""
echo "name of the VG"
echo "exemple: rootvg"
echo "after press enter"
read VG
lvmstat -v $VG
;;
19)
echo ""
echo "name of the Logical Volume"
echo "exemple: hd6"
echo "after press enter"
read VG
lvmstat -l $VG
;;
20)
echo ""
echo "name of the Volume Group"
echo "exemple: rootvg"
echo "press enter"
read VG
lvmstat -d -v $VG
lvmstat -e -v $VG
;;
21)
echo ""
echo "name of the Volume Group"
echo "exemple: rootvg"
echo "after press enter"
read VG
lvmstat -d -v $VG
;;
*)
echo "no record for this choice"
;;
esac
![[worm] [worm] [worm]](/data/assets/smilies/worm.gif)