常用的主机监控shell脚本

文章作者 100test 发表时间 2012:03:17 17:37:37
来源 100Test.Com百考试题网


  下面是我常用的几个主机监控的脚本,大家可以根据自己的情况在进行修改,希望能给大家一点帮助。

  1、查看主机网卡流量

  #!/bin/bash #network #Mike.Xu while : ; do time=date %m"-"%d" "%k":"%M day=date %m"-"%d rx_before=ifconfig eth0|sed -n "8"p|awk {print $2}|cut -c7- tx_before=ifconfig eth0|sed -n "8"p|awk {print $6}|cut -c7- sleep 2 rx_after=ifconfig eth0|sed -n "8"p|awk {print $2}|cut -c7- tx_after=ifconfig eth0|sed -n "8"p|awk {print $6}|cut -c7- rx_result=$[(rx_after-rx_before)/256] tx_result=$[(tx_after-tx_before)/256] echo "$time Now_In_Speed: "$rx_result"kbps Now_OUt_Speed: "$tx_result"kbps" sleep 2 done

  2、系统状况监控

  #!/bin/sh #systemstat.sh #Mike.Xu IP=192.168.1.227 top -n 2| grep "Cpu"


相关文章


linux下安装ACE
unix环境高级编程
LinuxWEB服务器CMWAP访问缓慢问题
Linux下相同配置的机器间内核拷贝
常用的主机监控shell脚本
linux时间函数
linux系统管理员学习笔记
2012年RHCA认证考试介绍
2012年RHCE认证考试介绍
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛