内容字号:默认大号超大号

段落设置:段首缩进取消段首缩进

字体设置:切换到微软雅黑切换到宋体

Linux服务器:流量监控MRTG

2019-01-07 20:05 出处:清屏网 人气: 评论(0

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, 这样就可以访问了

分享给小伙伴们:
本文标签: MRTGLinux

相关文章

发表评论愿您的每句评论,都能给大家的生活添色彩,带来共鸣,带来思索,带来快乐。

CopyRight © 2015-2016 QingPingShan.com , All Rights Reserved.

清屏网 版权所有 豫ICP备15026204号