Mrtg的安装

2009-05-13 14:33:15来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

Mrtg的安装
服务器配置:
至强3.0GHZ *2
4G ECC DDR内存
300G SCSI Utrl 320 15K 硬盘 *2
操作系统:freebsd 7.0

一、apache 安装
1. cd /usr/ports/www/apache2
   make install clean

2. apache安装目录结构:
Installing configuration files
/usr/local/etc/apache2
/usr/local/share/examples/apache2
/usr/local/www/data-dist
/usr/local/www/error-dist
/usr/local/www/icons-dist
/usr/local/www/cgi-bin-dist
/usr/local/share/doc/apache2

3. 手动启动apache2
/usr/local/sbin/httpd $

4. 自动启动文件:
/usr/local/etc/rc.d/apache2

5. apache配置:
ee /etc/rc.conf
apache2_enable="YES"
cd /usr/local/etc/apache2/
cp /usr/local/etc/apache2/httpd.conf /usr/local/etc/apache2/httpd.conf.new
mv /usr/local/etc/apache2/httpd.conf /usr/local/etc/apache2/httpd.conf.bak
grep  -v "#" ./httpd.conf.new > ./httpd.conf
   
ee /usr/local/etc/apache2/httpd.conf
加入:
Alias /mrtg "/usr/local/www/data/mrtg"
    AuthType Basic
    AuthName "This is a private directory. Please Login:"
    AuthUserFile /usr/local/www/data/passwd
    Require user tigerjxh
htpasswd -c /usr/local/www/data/passwd tigerjxh
New password:
Re-type new password:
apachectl restart


二、安装net-snmp/ucd-snmp/p5-SNMP
http://net-snmp.sourceforge.net/tutorial/tutorial-5/mrtg/index.html
1. cd /usr/ports/net-mgmt/net-snmp
   make install clean       #出现相关提示
        
2. 配置snmp   
mkdir -p /usr/local/etc/snmp
cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmp/snmpd.conf.new
cd /usr/local/etc/snmp/
grep -v "#" ./snmpd.conf.new  >./snmpd.conf
ee snmpd.conf
#vim /usr/local/etc/snmp/snmpd.conf
下面是我的配置文件内容
com2sec local localhost private
com2sec mynet 192.168.0.0/24 public
com2sec public default public
group mygroup v1 mynet
group mygroup v2c mynet
group mygroup usm mynet
group local v1 local
group local v2c local
group local usm local
group public v1 public
group public v2c public
group public usm public
view all included .1 80
access mygroup "" any noauth exact mib2 none none
access public "" any noauth exact all none none
access local "" any noauth exact all all all
syslocation Right here, right now.
syscontact Me
proc mountd
proc ntalkd 4
proc sendmail 10 1
exec echotest /bin/echo hello world
disk / 10000
load 12 14 14

3. 手动启动snmpd
/usr/local/sbin/snmpd &

4. 自动启动snmpd监听服务:
ee /etc/rc.conf进行配置,在该文件种添加下面内容:

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:创建FreeBSD的DVD.iso安装光盘

下一篇:关机