当前位置:首页 > 服务器类 > Linux服务器 > > Linux服务器维护 统计连接数查看外部IP

Linux服务器维护 统计连接数查看外部IP

点击次数:22 次 发布日期:2008-11-21 23:18:06 作者:源代码网
源代码网推荐

服务器上的一些统计数据:
 
  1)统计80端口连接数
 
  netstat -nat|grep -i "80"|wc -l
 
  1
 
  2)统计httpd协议连接数
 
  ps -ef|grep httpd|wc -l
 
  1
 
  3)、统计已连接上的,状态为“established"
 
  netstat -na|grep ESTABLISHED|wc -l
 
  2
 
  4)、查出哪个IP地址连接最多,将其封了。
 
    netstat -na|grep ESTABLISHED|awk "{print $5}"|awk -F: "{print {GetProperty(Content)}}"|sort|uniq -c|sort -r +0n

netstat -na|grep SYN|awk "{print $5}"|awk -F: "{print {GetProperty(Content)}}"|sort|uniq -c|sort -r +0n
 

源代码网供稿.
网友评论 (0)
会员中心
服务器类
本站推荐
服务器类之精华