蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 系统管理


Linux服务器如何统计连接数查看外部IP
蓝森林 http://www.lslnet.com 2008年3月5日 04:57







服务器上的一些统计数据:

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-自由软件



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com