免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5512 | 回复: 4
打印 上一主题 下一主题

[Web] [请教]MRTG没有流量图,求救 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-04-29 17:38 |只看该作者 |倒序浏览
我是新手,这个问题已经搞了两天了
先说下前提
系统是Centos4,想监控本机网卡流量
我的httpd和snmpd还有mrtg都是从用yum install *httpd*(*snmp* *mrtg*)装的
默认安装
我的主页存放在/var/www下
工作目录是/var/www/mrtg
-------------------------------      1
[root@localhost mrtg]# cfgmaker --output=./mrtg-1.cfg public@localhost.localdomain
--base: Get Device Info on public@localhost.localdomain:
--base: Vendor Id:
--base: Populating confcache
--snpo: Skipping ifName scanning because public@localhost.localdomain: does not seem to support it(是错误么?怎么改呢?)
--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Walking ifSpeed
--base: Writing ./mrtg-1.cfg
-------------------------------      2
....
WorkDir: /var/www/mrtg
....
Options[_]: growright, bits
....
-------------------------------      3
[root@localhost mrtg]# mrtg ./mrtg-1.cfg
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work properly when the environment
       variable LANG is set to UTF-8. Please run mrtg in an environment
       where this is not the case. Try the following command to start:

       env LANG=C /usr/bin/mrtg ./mrtg-1.cfg
-----------------------------------------------------------------------
(错误,已解决)
[root@localhost mrtg]# LANG=C(解决)
[root@localhost mrtg]# mrtg ./mrtg-1.cfg
[root@localhost mrtg]#
[root@localhost mrtg]# mrtg ./mrtg-1.cfg
[root@localhost mrtg]# mrtg ./mrtg-1.cfg
[root@localhost mrtg]# mrtg ./mrtg-1.cfg
-------------------------------      4
[root@localhost mrtg]# indexmaker --output=./mrtg-1.html ./mrtg-1.cfg
Use of uninitialized value in hash element at /usr/bin/indexmaker line 340.(错误)
[root@localhost mrtg]# indexmaker --output=./mrtg-1.html ./mrtg-1.cfg
Use of uninitialized value in hash element at /usr/bin/indexmaker line 340.(错误)
[root@localhost mrtg]#
-------------------------------      5
用另外一台局域网内机器查看:
http://*.*.*.*/mrtg/mrtg-1.html
可以访问,但是只能看见这些,流量图看不见,请高手指点


MSN:lh_lele@hotmail.com
恭候高手指点
万分感谢!

[ 本帖最后由 jaly7272 于 2007-5-17 10:56 编辑 ]

mrtg.JPG (62.7 KB, 下载次数: 46)

MRTG监控

MRTG监控

论坛徽章:
0
2 [报告]
发表于 2007-04-29 18:24 |只看该作者
/usr/bin/indexmaker 文件
..................
..................
    # -----------------------------------------------------------
    # print the graph items
    # -----------------------------------------------------------
    my $itemnr = 0;
    my $first = $order[0];
    my $host = $$rcfg{host}{$first} || '';(第340行)

    $index .= "<a NAME=\"$host\"></a><tr><td>$$opt{headon}Interfaces of $host $$opt{headoff}</td></tr>" if $$opt{perhost};
    foreach my $item (@order) {

        if ($$opt{perhost}) {
                my $newhost = $$rcfg{host}{$item};
                if (!($host eq $newhost)) {
..................
..................

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
3 [报告]
发表于 2007-04-29 23:17 |只看该作者
--snpo: Skipping ifName scanning because public@localhost.localdomain: does not seem to support it

论坛徽章:
0
4 [报告]
发表于 2007-04-30 10:38 |只看该作者
那是什么意思 ?

论坛徽章:
0
5 [报告]
发表于 2007-05-03 21:37 |只看该作者
*/3 * * * * env LANG=C /usr/local/mrtg/bin/mrtg /mrtg.cfg

我在crontab里面加了一个lang变量做的,没问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP