仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 329|回复: 7
打印 上一主题 下一主题

[CentOS(社区)] 带来一篇CentOS6.3下装置开源流量监控软件Bandwidthd

[复制链接]
分手快乐 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-14 21:10:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
小知识:如果说Ubuntu是现今最受桌面用户欢迎的Linux操作系统,那么CentOS就是最受公司、企业、IDC喜爱的Linux发行版了。
比方:包括FTP、HTTP、P2P、TCP、UDP、ICMP协定的各自流量,以IP为统计工具.






1、基础编译组件装置
[root@localhost~]#yuminstallgcccppglibcglibc-develgcc-c++

2.PCAP/PNG/GDLibrary(图象处置库)
[root@localhost~]#yuminstalllibpcaplibpcap-devellibpnglibpng-develgdgd-devel

3、装置httpd
[root@localhost~]#yuminstallhttpdmod_ssl
[root@localhost~]#servicehttpdstart
[root@localhost~]#chkconfighttpdon

4、下载bandwidthd
[root@localhost~]#
wgethttp://jaist.dl.sourceforge.net/project/bandwidthd/bandwidthd/bandwidthd%202.0.1/bandwidthd-2.0.1.tgz

5、安bbandwidthd
解压bandwidthd
[root@localhost~]#tar-zxvfbandwidthd-2.0.1.tgz
编译
[root@localhost~]#cdbandwidthd-2.0.1
[root@localhostbandwidthd-2.0.1]#./configure
[root@localhostbandwidthd-2.0.1]#make;makeinstall

[root@localhost~]#ll/usr/local/bandwidthd
总用量64
-rwxr-xr-x1rootroot5332031915:15bandwidthd//启动bandwidthd文件
drwxr-xr-x2rootroot409631915:51etc//设置文件
drwxr-xr-x2rootroot409631915:25htdocs//web会见目次,能够作一个假造主机指过去

6、修正bandwidthd设置文件
[root@localhost~]#vim/usr/local/bandwidthd/etc/bandwidthd.conf
####################################################
#Bandwidthd.conf
#
#Commentedoutoptionsareheretoprovide
#documentationandrepresentdefaults

#Subnetstocollectstatisticson.Trafficthat
#matchesnoneofthesesubnetswillbeignored.
#SyntaxiseitherIPSubnetMaskorCIDR
subnet10.1.3.0255.255.255.0#设置监控的网段
#subnet192.168.0.0/24
subnet172.16.1.0/24

#Devicetolistenon
#Bandwidthdlistensonthefirstdeviceitdetects
#bydefault.Run"bandwidthd-l"foralistof
#devices.
dev"any"#(这是你要检测的网卡ethxany(一切),能够调剂为对应的收集毗连装备)

###################################################
#Optionsthatdontusuallygetchanged

#Anintervalis2.5minutes,thisishowmany
#intervalstoskipbeforedoingagraphingrun
skip_intervals1#默许2.5minutes革新

#Graphcutoffishowmanykmustbetransferedbyan
#ipbeforewebothertographit
graph_cutoff1024#默许1M以上的流量才有图形

#Putinte***ceinpromiscuousmodetoscoretotraffic
#thatmaynotberoutingthroughthehostmachine.
#promiscuoustrue#设置网卡在混同形式中纪录

#Logdatatocdffilehtdocs/log.cdf
output_cdftrue#bandwidthd目次中天生log2.cdflog.cdf格局数据纪录

#Readbackthecdffileonstartup
recover_cdftrue#在启动bandwidth时从头读取cdf的数据

#Libpcapformatfilterstringusedtocontrolwhatbandwidthdsees
#Pleasealwaysinclude"ip"inthestringtoavoidstrangeproblems
filter"ip"#ip为过滤工具

#DrawGraphsCThisdefaulttotruetographthetrafficbandwidthdisrecording
#Usuallysetthistofalseifyouonlywantcdfoutputor
#youareusingthedatabaseoutputoption.Bandwidthdwilluseverylittle
#ramandcpuifthisissettofalse.
graphtrue#图形天生

#SetMETAREFRESHseconds(default150,use0todisable).
meta_refresh150#网页革新工夫

:wq#保留

7、在web主目次下做bandwidthd软毗连,实行
[root@localhost~]#cd/var/www/html/
[root@localhosthtml]#ln-s/usr/local/bandwidthd/htdocsbandwidthd

8、启动bandwidthdhttpd
[root@localhost~]#cd/usr/local/bandwidthd
[root@localnamebandwidthd]#./bandwidthd
[root@localhostbandwidthd]#servicehttpdrestart

9、设定开机主动启动bandwidthd
[root@localhost~]#vim/etc/rc.local
在最初增加内容:
#bandwidthd流量监控
/usr/local/bandwidthd/bandwidthd

11、过几分钟,就能够扫瞄bandwidthd天生的图形报表
http://IP/bandwidthd




小知识:虽然与RedHat之间并没有正式的联系,但OpenLogic提供CentOS支持的计划仍然会依赖于——或者说至少部分依赖于RedHat社区。
灵魂腐蚀 该用户已被删除
沙发
发表于 2015-1-17 06:41:14 | 只看该作者
通过自学老师给的资料和向同学请教,掌握了一些基本的操作,比如挂载优盘,编译程序,在Linux环境下运行,转换目录等等。学了这些基础才能进行下面的模拟OS程序。?
乐观 该用户已被删除
板凳
发表于 2015-1-24 13:59:26 | 只看该作者
目前全球有超过一百多个Linux发行版本,在国内也能找到十几个常见版本。如何选择请根据你的需求和能力,RedhatLinux和DebianLinux是网络管理员的理想选择。
金色的骷髅 该用户已被删除
地板
发表于 2015-2-1 17:17:41 | 只看该作者
生成新的unispimsp.ksc。”另外得到回复后如果问题解决,向帮助过你的人发个说明,让他们知道问题是怎样解决的。
愤怒的大鸟 该用户已被删除
5#
发表于 2015-2-7 13:47:11 | 只看该作者
放手去搞。尽量不要提问,运用搜索找答案,或者看wiki,从原理上理解操作系统的本质,而不是满足于使用几个技巧。尽量看英文资料。
精灵巫婆 该用户已被删除
6#
发表于 2015-2-22 18:11:37 | 只看该作者
Windows?是图形界面的,Linux类似以前的?DOS,是文本界面的,如果你运行了图形界面程序X-WINDOWS后,Linux?也能显示图形界面,也有开始菜单、桌面、图标等。
再现理想 该用户已被删除
7#
发表于 2015-3-14 12:39:34 | 只看该作者
熟悉并掌握安装Linux,安装是学习的前提。目前较常见的安装方法有二种:
变相怪杰 该用户已被删除
8#
发表于 2015-3-21 09:44:55 | 只看该作者
期间我阅读了不少关于Linux的相关资料,其中也不乏一些有趣的小故事,这既丰富了我的课余生活,也让我加深了对一些术语的理解,比玩游戏强多了。?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-23 19:09

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表