服务器状态持续监控脚本

#!/bin/bash
while :
do
uptime |awk '{print "CPU",$6,$7,$8,$9,$10}'
free -h |awk '/^Mem/{print "free Memory:"$4}'
df -h |awk '/\/$/{print "free Disk:"$4}'
awk '{i++}END{print "USERS:"i}' /etc/passwd
echo "logins now:`who |wc -l`"
echo "Process:`ps aux |wc -l`"
ifconfig eth1 |awk '/RX p/{print "Network receive:"$5"Kb"}'
ifconfig eth1 |awk '/TX p/{print "Network Send:"$5"Kb"}'
echo "Installed Software:`rpm -qa |wc -l`"
sleep 3
clear
done

猜你喜欢

转载自www.cnblogs.com/guarding/p/12513033.html