2014년 3월 13일 목요일

CentOS 6.5 MRTG 설치

yum  -y  install  perl gd libpng zlib mrtg httpd net-snmp net-snmp-utils

echo "view systemview included .1.3.6.1.2.1.2.2.1.10"  >>  /etc/snmp/snmpd.conf
echo "view systemview included .1.3.6.1.2.1.2.2.1.16"  >>  /etc/snmp/snmpd.conf
service snmpd restart

echo "Target[eth0]: 2:public@127.0.0.1"  >>  /etc/mrtg/mrtg.cfg
echo "MaxBytes[eth0]: 1250000"  >> /etc/mrtg/mrtg.cfg
echo "Title[eth0]: Traffic Analysis"  >> /etc/mrtg/mrtg.cfg
echo "PageTop[eth0]:

127.0.0.1 eth0

"  >> /etc/mrtg/mrtg.cfg

env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg

indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html

echo  "*/5 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg  > /dev/null 2>&1   " >>  /etc/crontab

sed -i -e "s@Deny from all@#Deny from all@" /etc/httpd/conf.d/mrtg.conf

service httpd restart




vi  /etc/httpd/conf.d/mrtg.cfg


    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    # Allow from .example.com
< /Location>




    Order deny,allow
    Deny from all

    Allow from 192.168.100.100
    Allow from 172.16
    Allow from 192.168.128.0/255.255.255.0
    Allow from 10.1.0.0/16

    Allow from 127.0.0.1
    Allow from ::1
    # Allow from .example.com
< /Location>


댓글 없음:

댓글 쓰기