July 2nd, 2008 by icez | Posted in Linux | 6 Comments »
ขั้นตอนพวกนี้ ก๊อปปี้แล้ววางได้เลยครับ
จดไว้กันลืม 555+
ทำมาด้วยความขี้เกียจของตัวข้าพเจ้าเองแหละ
yum -y install net-snmp mrtg
wget -4 -O /etc/snmp/snmpd.conf www.icez.net/files/snmpd.conf
wget -4 -O /var/www/mrtg/mrtg-load.sh www.icez.net/files/mrtg-load.sh
chmod a+x /var/www/mrtg/mrtg-load.sh
/etc/init.d/snmpd restart
cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits,growright' --no-down --zero-speed=1000000000 --noreversedns --output /var/www/mrtg/mrtg.cfg --ifdesc=name --snmp-options=:::::2 public@localhost
wget -4 -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
echo "Alias /mrtg /var/www/mrtg" > /etc/httpd/conf.d/mrtg.conf
/sbin/chkconfig snmpd on
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
if [ -d /usr/local/directadmin ]; then ln -s /var/www/mrtg /var/www/html/; fi
/etc/init.d/httpd graceful |
yum -y install net-snmp mrtg
wget -4 -O /etc/snmp/snmpd.conf www.icez.net/files/snmpd.conf
wget -4 -O /var/www/mrtg/mrtg-load.sh www.icez.net/files/mrtg-load.sh
chmod a+x /var/www/mrtg/mrtg-load.sh
/etc/init.d/snmpd restart
cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits,growright' --no-down --zero-speed=1000000000 --noreversedns --output /var/www/mrtg/mrtg.cfg --ifdesc=name --snmp-options=:::::2 public@localhost
wget -4 -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
echo "Alias /mrtg /var/www/mrtg" > /etc/httpd/conf.d/mrtg.conf
/sbin/chkconfig snmpd on
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
if [ -d /usr/local/directadmin ]; then ln -s /var/www/mrtg /var/www/html/; fi
/etc/init.d/httpd graceful
สั้นๆ ง่ายๆ ได้ใจความ
ปล. สำหรับ fedora 9 ไอ้ mrtg ที่แถมมามันรันไม่ขึ้น ไม่รู้เน่าตรงไหน
ก็เลยต้อง compile เพิ่มเองนิดหน่อยครับ
ขั้นตอนตามนี้ (copy แล้ววางอีกแล้วครับทั่น)
cd /usr/local/src
wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.16.4.tar.gz
tar zxf mrtg-2.16.4.tar.gz
cd mrtg-2.16.4
yum -y install libpng-devel gd-devel
./configure --prefix=/usr/local/mrtg && make && make install
echo "*/5 * * * * root LANG=C LC_ALL=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok" > /etc/cron.d/mrtg |
cd /usr/local/src
wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.16.4.tar.gz
tar zxf mrtg-2.16.4.tar.gz
cd mrtg-2.16.4
yum -y install libpng-devel gd-devel
./configure --prefix=/usr/local/mrtg && make && make install
echo "*/5 * * * * root LANG=C LC_ALL=C /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok" > /etc/cron.d/mrtg
Tags: install, mrtg