歡迎您光臨本站 註冊首頁

[請教]MRTG沒有流量圖,求救

←手機掃碼閱讀     火星人 @ 2014-03-05 , reply:0

[請教]MRTG沒有流量圖,求救

我是新手,這個問題已經搞了兩天了:em16:
先說下前提
系統是Centos4,想監控本機網卡流量
我的httpd和snmpd還有mrtg都是從用yum install *httpd*(*snmp* *mrtg*)裝的
默認安裝
我的主頁存放在/var/www下
工作目錄是/var/www/mrtg
-------------------------------      1
# 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
# 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
-----------------------------------------------------------------------(錯誤,已解決)
# LANG=C(解決)
# mrtg ./mrtg-1.cfg
#
# mrtg ./mrtg-1.cfg
# mrtg ./mrtg-1.cfg
# mrtg ./mrtg-1.cfg
-------------------------------      4
# indexmaker --output=./mrtg-1.html ./mrtg-1.cfg
Use of uninitialized value in hash element at /usr/bin/indexmaker line 340.(錯誤)
# indexmaker --output=./mrtg-1.html ./mrtg-1.cfg
Use of uninitialized value in hash element at /usr/bin/indexmaker line 340.(錯誤)
#
-------------------------------      5
用另外一台區域網內機器查看:
http://*.*.*.*/mrtg/mrtg-1.html
可以訪問,但是只能看見這些,流量圖看不見,請高手指點


MSN:lh_lele@hotmail.com
恭候高手指點
萬分感謝!

[ 本帖最後由 jaly7272 於 2007-5-17 10:56 編輯 ]
《解決方案》

/usr/bin/indexmaker 文件
..................
..................
    # -----------------------------------------------------------
    # print the graph items
    # -----------------------------------------------------------
    my $itemnr = 0;
    my $first = $order;
    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)) {
..................
..................
《解決方案》

--snpo: Skipping ifName scanning because public@localhost.localdomain: does not seem to support it
《解決方案》

那是什麼意思 ?
《解決方案》

*/3 * * * * env LANG=C /usr/local/mrtg/bin/mrtg /mrtg.cfg

我在crontab裡面加了一個lang變數做的,沒問題

[火星人 ] [請教]MRTG沒有流量圖,求救已經有1049次圍觀

http://coctec.com/docs/service/show-post-39326.html