首先要安裝snmpd:
apt-get install snmpd

設定SNMP:
/etc/snmp/snmpd.conf
修改下列
#com2sec paranoid default public
com2sec readonly default public
重新啟動
/etc/init.d/snmpd restart

安裝mrtg:
apt-get install mrtg
之後會進入一個畫面詢問你的mrtg.cfg檔要不要只讓mrtg使用者讀取
選擇Yes
然後利用cfgmaker自動產生設定:
cfgmaker public@localhost >> /etc/mrtg.cfg
注意,是>>,附加在原本的檔案之後。
話說回來直接覆蓋好像也沒有什麼影響XD

執行mrtg:
env LANG=C mrtg /etc/mrtg.cfg
一開始會有警告訊息產生,多執行幾次之後就沒了。

MRTG預設的工作路徑為/var/www/mrtg
要建立一個index檔,使用indexmaker:
indexmaker -title="你想要的title" --output=/var/www/mrtg/index.html /etc/mrtg.cfg
然後去http://<你的網址>/mrtg/看,應該就看得到MRTG所產生的圖

參考資料:
網路監控(MRTG)
鳥哥的Linux私房菜--MRTG流量偵測法
Advanced MRTG for Linux
arrow
arrow
    全站熱搜

    ljhuang 發表在 痞客邦 留言(0) 人氣()