网络流量分析:
一安装SNMP简单网络管理协议:
cd /usr/ports/net/net-snmp
make install
make clean
编辑snmp.conf配置文件:
cd /usr/local/share/snmp/
vi snmpd.conf
rocommunity mrtg
启动SNMP:
cd /usr/local/etc/rc.d
rm snmpd.sh
vi snmpd.sh
#! /bin/sh
/usr/local/sbin/snmpd
二安装MRTG:
cd /usr/ports/net/mrtg
make install
make clean
cd /usr/local/etc/mrtg
/usr/local/bin/cfgmaker mrtg@192.168.1.100 > mrtg
vi mrtg
添加mrtg的工作目录:
WorkDir: /home/dyd/public_html/mrtg
Language: chinaese
在/home/dyd/public_html/mrtg目录里生成index.html
/usr/local/bin/indexmaker --title '标题' --output /home/dyd/public_html/mrtg/index.html mrtg
/usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg #多执行几遍直到没有错误为止。
如果想定时执行mrtg的话就加入到crontab里就可以了。
阅读(426) | 评论(0) | 转发(0) |