AIX 内存使用情况 硬盘使用情况

cat > WHAT_EVER_YOU_WANT.sh
#!/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";

echo "\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";
bash-4.2# chmod +x ./WHAT_EVER_YOU_WANT.sh
bash-4.2# ./WHAT_EVER_YOU_WANT.sh

 

#=================

nmon

h -- help

m -- memory

 

#=================

列出内存占用率前10的进程相关信息:

svmon -Pt10 | perl -e 'while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}'

用svmon -P pid查看某个进程内存堆栈:

svmon -P pid

查看内存使用情况:

svmon

 

==================

硬盘使用情况

df -g

posted @ 2014-07-19 15:11  emanlee  阅读(854)  评论(0编辑  收藏  举报