赞
踩
FREECPU=`iostat | head -4 | tail -1 | cut -d' ' -f31`
USEDCPU=`echo 100 - ${FREECPU}|bc`
echo "FREECPU: ${FREECPU} USEDCPU: ${USEDCPU} "
TOTALMEM=`free -m | grep "Mem:" | cut -d' ' -f12`
USEDMEM=`free -m | grep "Mem:" | cut -d' ' -f20`
FREEMEM=`free -m | grep "Mem:" | cut -d' ' -f29`
echo "TOTALMEM: ${TOTALMEM} USEDMEM: ${USEDMEM} FREEMEM: ${FREEMEM} "
TOTALSWAP=`free -m | grep "Swap:" | cut -d' ' -f10`
USEDSWAP=`free -m | grep "Swap:" | cut -d' ' -f20`
FREESWAP=`free -m | grep "Swap:" | cut -d' ' -f27`
echo "TOTALSWAP: ${TOTALSWAP} USEDSWAP: ${USEDSWAP} FREESWAP: ${FREESWAP}"
FREECPU=`iostat | head -4 | tail -1 | cut -d' ' -f31`
USEDCPU=`echo 100 - ${FREECPU}|bc`
echo "FREECPU: ${FREECPU} USEDCPU: ${USEDCPU} "
TOTALMEM=`free -m | grep "Mem:" | awk '{print $2}'`
USEDMEM=`free -m | grep "Mem:" | awk '{print $3}'`
FREEMEM=`free -m | grep "Mem:" | awk '{print $4}'`
echo "TOTALMEM: ${TOTALMEM} USEDMEM: ${USEDMEM} FREEMEM: ${FREEMEM} "
TOTALSWAP=`free -m | grep "Swap:" | cut -d' ' -f10`
USEDSWAP=`free -m | grep "Swap:" | cut -d' ' -f20`
FREESWAP=`free -m | grep "Swap:" | cut -d' ' -f27`
echo "TOTALSWAP: ${TOTALSWAP} USEDSWAP: ${USEDSWAP} FREESWAP: ${FREESWAP}"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。