Linux服务器---流量监控MRTG

栏目: 服务器 · 发布时间: 6年前

SNMP 协议。将收集到的数据生成 HTML 文件,以图片的形式展示出来

[root@localhost bandwidthd-2.0.1]#  yum install -y net-snmp

snmp ,编辑配置文件“ /etc/snmp/snmpd.conf

[root@localhost bandwidthd]#  gedit /etc/snmp/snmpd.conf

view    systemview    included  .1.3.6.1.2.1.1

view    systemview    included  .1.3.6.1.2.1.25.1.1

view    systemview    included  .1.3.6.1.2.1.2

snmp 服务

[root@localhost bandwidthd]#  service snmpd start

正在启动 snmpd                                            [ 确定 ]

[root@localhost bandwidthd]#

bandwidthd 软件( https://oss.oetiker.ch/mrtg/pub/?M=D yum 方式在线安装

[root@localhost bandwidthd]#  yum install -y mrtg

”/etc/httpd/conf.d/mrtg.conf”

[root@localhost bandwidthd]#  gedit /etc/httpd/conf.d/mrtg.conf 

Order deny,allow

#    Deny from all      //这句要注释掉

Allow from all      //这里为all,允许检测所有ip

Allow from ::1

# Allow from .example.com

mrtg 文件,并做一些修改。

[root@localhost bandwidthd]#  cfgmaker public@192.168.0.113>/etc/mrtg/mrtg.cfg       // 生成文件,注意 ip 地址需要用户自己设置

[root@localhost bandwidthd]#  gedit /etc/mrtg/mrtg.cfg      // 修改文件

#  for UNIX

WorkDir: /var/www/mrtg      //当前处于centos系统,因此这句去掉注释.这个路径是apache下的网页路径

#  or for NT

# WorkDir: c:\mrtgdata

### Global Defaults

#  to get bits instead of bytes and graphs growing to the right

Options[_]: growright, bits    //去掉注释

html 文件,执行三次指令

[root@localhost bandwidthd]#  env LANG=C mrtg /etc/mrtg/mrtg.cfg   // 第一次

2018-08-22 14:50:00, Rateup WARNING: /usr/bin/rateup could not read the primary log file for 192.168.0.113_2

2018-08-22 14:50:00, Rateup WARNING: /usr/bin/rateup The backup log file for 192.168.0.113_2 was invalid as well

2018-08-22 14:50:00, Rateup WARNING: /usr/bin/rateup Can't remove 192.168.0.113_2.old updating log file

2018-08-22 14:50:00, Rateup WARNING: /usr/bin/rateup Can't rename 192.168.0.113_2.log to 192.168.0.113_2.old updating log file

[root@localhost bandwidthd]#  env LANG=C mrtg /etc/mrtg/mrtg.cfg    // 第二次

[root@localhost bandwidthd]#  env LANG=C mrtg /etc/mrtg/mrtg.cfg    // 第三次

127.0.0.1/mrtg/192.168.0.113_2.html, 这样就可以访问了

Linux服务器---流量监控MRTG


以上所述就是小编给大家介绍的《Linux服务器---流量监控MRTG》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

删除

删除

[英] 维克托•迈尔-舍恩伯格(Viktor Mayer-Schönberger)著 / 袁杰 译 / 浙江人民出版社 / 2013-1 / 49.90元

《删除》讲述了遗忘的美德,为读者展现了大数据时代的取舍之道。 《删除》从大数据时代信息取舍的目的和方法分别诠释了“被遗忘的权利”。维克托首先回溯了人类追寻记忆的过程,之后提出数字技术与全球网络正在瓦解我们天生的遗忘能力。对此,他考察了促进遗忘终止4大驱动力——数字化,廉价的存储器,易于提取,全球性访问。之后,他提出了当前数字化记忆的两大威胁——信息权力与时间,并给出了应对威胁的6大对策——数......一起来看看 《删除》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

html转js在线工具
html转js在线工具

html转js在线工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具