Tuesday, December 21, 2010

ลง Mrtg สำหรับ CentOS ที่ใช้ Directadmin

yum -y install net-snmp mrtg
wget -O /etc/snmp/snmpd.conf www.icez.net/files/snmpd.conf
mkdir -p /var/www/html/mrtg/
wget -O /var/www/html/mrtg/mrtg-load.sh www.icez.net/files/mrtg-load.sh
chmod a+x /var/www/html/mrtg/mrtg-load.sh
if [ ! -e /usr/bin/php ]; then if [ -f /usr/local/bin/php ]; then ln -s /usr/local/bin/php /usr/bin/php ; fi ; fi
/etc/init.d/snmpd restart
cfgmaker --global 'WorkDir: /var/www/html/mrtg' --global 'Options[_]: bits,growright' --output /var/www/html/mrtg/mrtg.cfg public@localhost
wget -O /tmp/mrtg.cfg www.icez.net/files/mrtg.cfg
cat /tmp/mrtg.cfg >> /var/www/html/mrtg/mrtg.cfg
/bin/cp -fv /var/www/html/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg
echo "Alias /mrtg /var/www/html/mrtg" > /etc/httpd/conf.d/mrtg.conf
/sbin/chkconfig snmpd on
indexmaker /etc/mrtg/mrtg.cfg > /var/www/html/mrtg/index.html
/etc/init.d/httpd graceful
 
หากมีการเพิ่ม lan interface ใหม่
cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits,growright' --output /var/www/mrtg/mrtg.cfg public@localhost
wget -O /tmp/mrtg.cfg www.icez.net/files/mrtg.cfg
cat /tmp/mrtg.cfg >> /var/www/mrtg/mrtg.cfg
/bin/cp -fv /var/www/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
 

0 comments:

Post a Comment

 
Design by GURU