`
victorwmh
  • 浏览: 208103 次
  • 性别: Icon_minigender_1
  • 来自: 宇宙
社区版块
存档分类
最新评论

常用shell脚本

阅读更多

常用shell脚本集

1、监测来自某个IP的TCP活动连接数

#!/bin/sh
while true
do
  time=$(date '+%Y-%m-%d %H:%M:%S')
  tcp=$(netstat -ano|grep 9100 |grep 192.168.0.236 |wc -l)
  out="$time tcp connect counter=$tcp"
  echo $out >> t.log
  sleep 5
done

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics