Instalasi dan Konfigurasi SNMP Server dan MRTG di Linux -------------------------------------------------------- 1. Penulis menggunakan Distro CenTos 3.4 2. Paket yang dibutuhkan: [root@dell root]# rpm -qa | grep snmp net-snmp-5.0.9-2.30E.12 net-snmp-utils-5.0.9-2.30E.12 net-snmp-devel-5.0.9-2.30E.12 net-snmp-libs-5.0.9-2.30E.12 net-snmp-perl-5.0.9-2.30E.12 3. Backup file snmp.conf: [root@dell root]# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak 4. Isi dari file snmp.conf: com2sec public default public group public v1 public group public v2c public group public usm public view all included .1 access public "" any noauth exact all none none 5. Jalankan SNMP: [root@dell root]# /etc/rc.d/init.d/snmpd start 6. Cek service SNMP: [root@dell root]# ps ax | grep snmp 24433 ? S 0:00 /usr/sbin/snmpd -s -l /dev/null -P /var/run/snmpd -a 24437 pts/0 S 0:00 grep snmp 7. Cek port SNMP: [root@dell root]# netstat -pln | grep snmp tcp 0 0 0.0.0.0:199 0.0.0.0:* LIST EN 24433/snmpd udp 0 0 0.0.0.0:161 0.0.0.0:* 24433/snmpd 8. Aktifkan Web Server Apache (Penulis mengguanakan apache versi 2): [root@dell root]# /usr/local/apache2/bin/apachectl start 9. Buat direktori mrtg pada direktori root apache: [root@dell root]# mkdir /usr/local/apache2/htdocs/mrtg 10.Pastikan terdapat paket mrtg pada linux box anda: [root@dell root]# rpm -qa | grep mrtg mrtg-2.9.29-4.ent 11.Membuat cfgmaker: (misal: snmp server diinstal pada pc dengan IP address 192.168.100.218) [root@dell snmp]# cfgmaker --global "WorkDir: /usr/local/apache2/htdocs/mrtg" -- global "Options[_]:growright,bits" public@192.168.100.218 > /etc/mrtg/192.168.10 0.218.cfg --base: Get Device Info on public@192.168.100.218: --base: Vendor Id: --base: Populating confcache --snpo: confcache public@192.168.100.218: Descr lo --> 1 --snpo: confcache public@192.168.100.218: Descr eth0 --> 2 --snpo: confcache public@192.168.100.218: Ip 127.0.0.1 --> 1 --snpo: confcache public@192.168.100.218: Ip 192.168.100.218 --> 2 --snpo: confcache public@192.168.100.218: Type 24 --> 1 --snpo: confcache public@192.168.100.218: Type 6 --> 2 --snpo: confcache public@192.168.100.218: Eth --> 1 --snpo: confcache public@192.168.100.218: Eth 00-12-3f-2e-83-b0 --> 2 --base: Get Interface Info --base: Walking ifIndex --base: Walking ifType --base: Walking ifAdminStatus --base: Walking ifOperStatus --base: Walking ifSpeed 12.Edit file 192.168.100.218.cfg: [root@dell root]# vi /etc/mrtg/192.168.100.218.cfg # tambahkan baris berikut # for UNIX # WorkDir: /home/http/mrtg WorkDir: /usr/local/apache2/htdocs/mrtg # dan tambahkan baris berikut: RunAsDaemon:Yes Interval:5 Refresh:300 13.Jalankan mrtg pda file 192.168.100.218.cfg [root@dell snmp]# env LANG=C mrtg /etc/mrtg/192.168.100.218.cfg Rateup WARNING: /usr/bin/rateup could not read the primary log file for 192.168. 100.218_2 Rateup WARNING: /usr/bin/rateup The backup log file for 192.168.100.218_2 was in valid as well Rateup WARNING: /usr/bin/rateup Can't remove 192.168.100.218_2.old updating log file Rateup WARNING: /usr/bin/rateup Can't rename 192.168.100.218_2.log to 192.168.10 0.218_2.old updating log file 14.Disini SNMP server dan MRTG diinstal pada mesin yang sama, sehingga untuk melihat hasil mrtg pada server tersebut , buka browser dan ketik alamat berikut: http://192.168.100.218/mrtg/ 15.Buat schedule dengan crontab , menjalankan mrtg tiap 5 menit [root@dell root]# crontab -e */5 * * * * /usr/bin/mrtg /etc/mrtg/192.168.100.218.cfg --logging=/var/log/server1.log java_ux I still write :D