!/bin/bash
nowday=date +%Y%m%d
cpuload=uptime
memuse=free -m|grep “Mem”|awk ‘{print $3}’
memfree=free -m|grep “Mem”|awk ‘{print $4}’
swapuse=free -m|grep “Swap”|awk ‘{print $3}’
swapfree=free -m|grep “Swap”|awk ‘{print $4}’
echo “当前时间:$nowday”
echo “CPU负载:$cpuload”
echo “内存已用:$memuse”
echo “内存剩余:$memfree”
echo “swap 已用$swapuse”
echo “swap 剩余$swapfree”
echo “磁盘使用情况”
df -h
echo “最近的十次登录”
last -10