POSTS
安裝MRTG 主機流量分析
SNMP
Simple Network Management Protocol
使用 PORTS 安裝:
cd /usr/ports/net-mgmt/net-snmp ; make install ; rehash 設定
/etc/rc.conf
加入下列設定內容:snmpd_enable=”YES”
snmpd_flags=”-p /var/run/snmpd.pid”/etc/hosts.allow
在第一行加入下列設定內容:snmpd : localhost : allow /usr/local/share/snmp/snmpd.conf
新建此檔案,內容如下:rocommunity mrtgmgr
syslocation FreeBSD
syscontact Maintainer
sysname LocalHost請 man snmpd.conf 以得到更詳細的說明。
- 啟動
/usr/local/sbin/snmpd -p /var/run/snmpd.pid
MRTG
Multi Router Traffic Grapher
使用 PORTS 安裝:
cd /usr/ports/net-mgmt/mrtg ; make install ; rehash 建立該當的資料夾:
mkdir /usr/local/www/data/mrtg cfgmaker
cfgmaker <br /> –global ‘WorkDir: /usr/local/www/data/mrtg’ <br /> –global ‘Options[]: growright, bits’ <br /> –global ‘Language: big5’ <br /> –global ‘WithPeak[]: wmy’ <br /> mrtgmgr@localhost <br /> > /usr/local/etc/mrtg/mrtg.cfg indexmaker
indexmaker <br /> –title ‘MRTG – 網路流量分析‘ <br /> –addhead=’’ <br /> –output /usr/local/www/data/mrtg/index.html <br /> –columns=1 <br /> –nolegend <br /> /usr/local/etc/mrtg/mrtg.cfg mrtg
/usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg 初次安裝者請反覆執行此指令稿(大約是三次),直至無錯誤產生為止。
crontab
*/5 * * * * root /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg