|
|
第 16 帖 | |
|
|
精彩~~~
![]() |
|
|
|
|
|
|
|
第 17 帖 | |
|
|
呵呵,iptables那参数没见过,,很多文章也没提到?奇怪
不错,,
__________________
And then in the evening light, when the bars of freedom fall I watch the two of you in the shadows on the wall How in the darkness steals some of the choices from my hand Then will I begin to under |
|
|
|
|
|
|
|
第 18 帖 | |
|
|
是哪个版本的iptables哦?我的没有quota的
|
|
|
|
|
|
|
|
第 19 帖 | |
|
|
为可不用iptraf呢?
|
|
|
|
|
|
|
|
第 20 帖 | |
|
|
为可不用iptraf呢?
|
|
|
|
|
|
|
|
第 21 帖 | |
|
|
IPTraf
Iface Total IP NonIP BadIP Activity lo 0 0 0 0 0.00 kbits/sec eth0 75261 75261 0 0 2117.60 kbits/sec |
|
|
|
|
|
|
|
第 22 帖 | |
|
|
代码:
|
|
|
|
|
|
|
|
第 23 帖 | |
|
|
代码:
|
|
|
|
|
|
|
|
第 24 帖 | |
|
|
代码:
|
|
|
|
|
|
|
|
第 25 帖 | |
|
|
代码:
|
|
|
|
|
|
|
|
第 26 帖 | |
|
|
标题: 一段时间的流量统计可以这样试试! 给你一个简陋的脚本!
希望你要明白它的原理,机制有了具体的策略还是要自己去弄的! 说简单点就是用脚本得到一段时间网卡流量的差值 netstat.sh #!/bin/bash #netstat.sh #用来统计一段时间内的网卡流量 #定义变量 netstat_log=/var/log/netstatlog cat /proc/net/dev |grep eth0 >$netstat_log/net_tmp.txt net_receive_new=`cat /proc/net/dev |grep eth0 |awk -F" " '{print$2}'` net_receive_old=`awk -F" " '{print$2}' /$netstat_log/net.txt` net_transmit_new=`cat /proc/net/dev |grep eth0 |awk -F" " '{print$10}'` net_transmit_old=`awk -F" " '{print$10}' /$netstat_log/net.txt` echo "`date +%Y-%m-%d`net_in" >>$netstat_log/net_stat.txt let net_in=$net_receive_new-$net_receive_old echo $net_in >> $netstat_log/net_stat.txt let net_out=$net_transmit_new-$net_transmit_old echo $net_out >>$netstat_log/net_stat.txt cd $netstat_log mv net_tmp.txt net.txt 当然不是root用户可以执行但日志的路径要注意改成自己的,可以自己添加到crontab 计划任务里面,一个月执行一次就会自己记录你想要的!
__________________
风雨依旧 吾同依旧 http://blog.dooben.cn 欢迎浏览 work:IBM X60 Fedora 13 bolghost:HP-epc PIII 1.0 内存256M centOS 5.4 |
|
|
|
|
|