CPU使用率:
top -b -n 1 | head -n 4 | grep "^Cpu(s)" | awk ‘{print $2}‘ | cut -d ‘u‘ -f 1
内存使用率:
free -m | grep ‘^-‘ | awk ‘{print $3/($3+$4)*100"%"}‘
IO使用率(DEVICE_PATH的值改成df -h出来的那些Filesystem名称即可):
DEVICE_PATH=/dev/sda1;iostat -x -j PATH ${DEVICE_PATH} | grep pci | awk ‘{print $NF"%"}‘