zoukankan      html  css  js  c++  java
  • Linux服务器维护统计连接数查看外部IP

     
     
     服务器上的一些统计数据:
     
      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 $1}'|sort|uniq -c|sort -r +0n
    netstat -na|grep SYN|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r +0n
    Linux服务器维护统计连接数查看外部IP
     
     服务器上的一些统计数据:
     
      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 $1}'|sort|uniq -c|sort -r +0n
    netstat -na|grep SYN|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r +0n
     
    5)
    netstat -na|grep ESTABLISHED|awk '{print $5}'|sort -k1n|awk '/:.*$/{ print $1}'  > /tmp/error_ip
    grep -E -o '([0-9]{1,3}[.]){3}' /tmp/error_ip|sort -k1n|uniq -c -d| awk '$1>100 {print $2"0" " "}' >/tmp/error_ip2

  • 相关阅读:
    Linux 文件误删 恢复
    RSS源 集合
    查询android系统数据库 自定义sql语句 办法
    Android通讯录数据库介绍与基本操作(增删改查)
    Android 监听短信 两种方式
    获取系统设置好的闹钟时间
    颜色 16进制对照表
    仿IPhone 长按图标删除应用,图标抖动效果
    配置文件的加载顺序和位置
    php7 使用dom动态生成xml文档
  • 原文地址:https://www.cnblogs.com/fenle/p/4612873.html
Copyright © 2011-2022 走看看