简记:分析路由器流量ip统计页面

这个页面是为了方便实时看路由器的流动——ip流的流量,以便快速分析* * *,如果有很多外网ip同时访问内网一个ip(内网有大量服务器,平时访问不会那么集中),那么该网页会有颜色提示,方便快速定位和排查* * *


http://download.fedoraproject.org/pub/epel/6/i386/epel wget -释放- 6 - 8. - noarch.rpm

rpm -ivh epel -释放- 6 - 8. - noarch。rpm

yum - y nfdump httpd安装php

mkdir - p/usr/local/nfdump/test

mkdir/流

乔恩apache。apache/流

setfacl - d - g: apache:特权/流

setfacl - d - u: apache:特权/流

nfcapd - z - w - d - l/usr/local/nfdump/test 60 0 9996 - p - s - t - t - s 2000

chkconfig httpd>回声“1”在

else  2美元;

,,回声“0”在2美元

fi




vim/var/www/html/index.php,主页,按一个,然后粘贴下面代码,其中1. php等是每个链路的单独页面,请自行添加

& lt; !DOCTYPE html>

& lt; html>

& lt; head>

& lt;元charset=皍tf - 8”在

& lt;元http-equiv=八⑿隆蹦谌?" 187 "在

& lt;/head>

& lt; body>

& lt; div祝辞

& lt; iframe宽度=" 400 "高度=" 485 "帧边缘=?”滚动=" yes " src=" https://www.yisu.com/zixun/1.php "祝辞& lt;/iframe>

& lt; iframe宽度=" 400 "高度=" 485 "帧边缘=?”滚动=" yes " src=" https://www.yisu.com/zixun/2.php "祝辞& lt;/iframe>

& lt; iframe宽度=" 400 "高度=" 485 "帧边缘=?”滚动=" yes " src=" https://www.yisu.com/zixun/3.php "祝辞& lt;/iframe>

& lt;/div>

& lt;/body>

& lt;/html>


vim/var/www/html/1.php,,,,,按,然后粘贴下面代码,其中链路名和路由器ip和snmp接口号要自己改

& lt; h3>链路名& lt;/h3>

& lt; ? php

$="/流/1. txt”;

$ b="/流/1”;

系统(sh/流量/流动。上海路由器ip snmp接口号“美元);

$ f=文件(" $ ");

foreach (f美元和美元线)echo $。& lt; br/祝辞,

系统(“sh/流/h b一美元”);

如果(“猫$ b==1) {

,,,,$ c=" background - color: # 93 ff93”;其他

} {

,,,,$ c=" ";

}

?在

& lt; html>

& lt;身体风格=' & lt; ?php echo $ c ?祝辞的祝辞

& lt;元http-equiv=八⑿隆蹦谌??8”在

& lt;/body>

& lt;/html>




访问http://服务器ip/索引。php,即可显示1分钟刷新的top60,


简记:分析路由器流量ip统计页面