Sekarang bikin tutorial tentang bikin snmp dan mrtg untuk monitoring tool.
langsung aja ya…..
PS: Perintah Configure selalu di tuliskan 1 baris tanpa terpisah
*****DISARANKAN UNTUK MEMAKAI NET-SNMP YG TERBARU****
Sebab pada bbrp kasus snmp versi yg lebih lama tidak dapat berjalan dgn baik
di Server FreeBSD saya. baru setelah paket SNMP yg paling baru di install
Akhirnya bisa berjalan lancar. saat artikel ini saya tulis versi SNMP yg
paling baru adalah 5.1.4
http://ftp.yz.yamagata-u.ac.jp/pub/network/net-snmp/
( udah ada yang versi net-snmp-5.3.tar.gz )
#tar -zxvf net-snmp-5.1.4.tar.gz
#cd net-snmp-5.1.4
# ./configure –prefix=/usr/local/snmp
#make
#make install
# ee /usr/local/snmp/share/snmp/snmpd.conf
*******Isinya************
com2sec public HOSTNAME 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
**** Ubah nama HOSTNAME (Hostname bisa diganti dengan IP ADDRESS)***
Setelah membuat file snmpd.conf, kita akan coba mengaktifkan snmp dengan perintah :
# /usr/local/snmp/sbin/snmpd -c /usr/local/snmp/share/snmp/snmpd.conf
cek apakah snmp daemon berjalan dgn baik?
# /usr/local/snmp/bin/snmpwalk -v 1 -c public HOSTNAME system
HOSTNAME diganti dengan hostname atau IP Address yang anda isikan pada file “snmpd.conf”,bila berhasil akan tampil informasi ttg snmp anda.
cth tanmpilan:
———
bla bla
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.8072.3.2.255
SNMPv2-MIB::sysUpTime.0 = Timeticks: (7256) 0:01:12.56
SNMPv2-MIB::sysContact.0 = STRING: root@
SNMPv2-MIB::sysName.0 = STRING: erakarya.afraid.org
SNMPv2-MIB::sysLocation.0 = STRING: Unknown
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.5 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.2 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.5 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
jalankan snmpdnya dari startup..agar Running setiap PC dihidupkan
contoh :
# echo “usr/local/snmp/sbin/snmpd -c /usr/local/snmp/share/snmp/snmpd.conf” >> /etc/rc.local
Page 2 of 5
————————
Sekarang kita mulai ke tahap MRTG.
c. MRTG = Multi Router Traffic Grapher
MRTG adalah suatu aplikasi yang bisa mengijinkan anda untuk mendapatkan data dari SNMP.
persiapan untuk MRTG :
1. gd …merupakan librari grafik
2. libpng …librari yg di butuhkan oleh GD
3. zlib …librari untuk kompres data yang di butuhkan oleh libpng
—————————————–
Instalasi zlib…http://www.gzip.org/zlib/
Download paket zlib nya dulu ..
extract tarballnya
# tar xzvf zlib-1.2.2.tar.gz
ubah nama direktori
# mv zlib-1.2.4 zlib
masuk ke direktori
# cd zlib
# ./configure
compile sourcenya
# make
install binarinya
# make install
—————————-
Install libpng…http://www.libpng.org
Download libpng nya dulu..
# tar zxvf libpng-1.2.5.tar.gz
ubah nama direktori
# mv libpng-1.2.5 libpng
masuk ke direktori
# cd libpng
copykan script makefile.std dari direktori scripts dan berikan nama baru
# cp scripts/makefile.std makefile
install binarinya
# make
#make install
//*
buat symlink dr /usr/local/lib/libpng.a ke /usr/lib/libpng.a hal ini di sebabkan pada freebsd saya saat menginstall gb. selalu mencari libpng ke directory /usr/lib . jadi untuk agar library utk png dapat di kenali maka harus di lakukan cara seperti yg di atas. (ps: hall ini tidak terjadi pada OS Linux Slackware saya.)
*//
——————————–
Page 3 of 5
sekarang kompile gd…http://www.boutell.com/gd/
extract tarballnya
# tar zxvf gd-2.0.33.tar.gz
ubah nama direktori
# mv gd-2.0.33 gd
masuk ke direktori
# cd gd
Konfigurasi
# ./configure –disable-shared
compile sourcenya
# make
install binarinya
# make install
——————–
Install MRTG…http://people.ee.ethz.ch/~oetiker/webtools/mrtg/
extract tarballnya
# tar zxvf mrtg-2.10.13.tar.gz
masuk ke direktori
# cd mrtg-2.10.13
persiapan konfigurasi…
# ./configure –prefix=/usr/local/mrtg –with-gd-lib=/usr/local/lib –with-gd-inc=/usr/local/include –with-png-lib=/usr/local/lib –with-png-inc=/usr/local/include
//*
** Ooops, one of many bad things happened:
a) You don’t have the GD library installed.
Get it from http://www.boutell.com, compile it and
use either –with-gd-lib=DIR and –with-gd-inc=DIR to specify
its location. You might also have to use –with-z-inc,
–with-z-lib and –with-png-inc, –with-png-lib for gd
versions 1.6 and higher. Check config.log for more
information on the problem.
b) You have the GD library installed, but not the gd.h
header file. Download the source (see above) and use
–with-gd-inc=DIR to specify where the file can be found.
c) You have the library and the header file installed, but
you also have a shared GD library in the same directory.
Remove the shared library files and/or links (e.g.
libgd.so.2.0.0, libgd.so and libgd.so.2). This is especially
likely if you’re using a recent (post 1.8.4) version of GD
and didn’t configure it with –disable-shared.
Consider following the instructions in doc/mrtg-unix-guide.txt
kalau anda menemukan error seperti ini. jangan panik. masuklah ke direktory /usr/local/lib dan buang saja file libgd.so,libgd.so.2.
hal ini di karenakan anda tidak mengaktifkan option –disable-shared pada saat instalasi library gd.
*//
Kompile sourcenya
# make
Install binary MRTG
# make install
untuk membuat file konfigurasi mrtg yg bernama “mrtg.cfg”
# cd /etc
#mkdir mrtg
#cd /usr/local/apache/htdocs
# mkdir mrtg
Jalankan perintah cfmaker untuk mengkonfigure mrtg
#/usr/local/mrtg/bin/cfgmaker –global ‘WorkDir:/usr/local/apache/htdocs/mrtg’ –global ‘Options[_]: bits,growright’ –output /etc/mrtg/mrtg.cfg public@202.152.28.82
selanjutnya buat index nya dengan indexmaker
#/usr/local/mrtg/bin/indexmaker –output /usr/local/apache/htdocs/mrtg/index.html /etc/mrtg/mrtg.cfg
//*
jalankan MRTG
ada dua cara memonitor device secara realtime, MRTG bisa di jalankan secara daemon atau dengan crontab.
untuk cara pertama sebelum anda buat indexmaker terlebih dahulu edit file mrtg.cfg, tambahkan line “RunAsDaemon= YES”.
cara kedua dengan crontab, misal kita mengingkan MRTG diupdate tiap 5 menit. maka tambahkan line pada crontab :
*//
#crontab -e
*/5 * * * * /usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
baru kemudian jalankan mrtg.
#/usr/local/mrtg/bin/mrtg /etc/mrtg/mrtg.cfg
Penutup:
Jalankan Browser anda ke http://host-server-anda.com/mrtg/
jika berhasil akan muncul grafik yang berisi informasi dr router/komputer yang akan kita monitor.
Done!
terima kasih untuk mas apin atas tutorialnya. sangat bermanfaat.
Terima kasih banyak artikelnya pak, sangat bermanfaat…
sama sama mas akbar.
Terima kasih pak ama artikelnya, tolong ditulis terus pak tentang arikel -artikel FREEBSD pak demi memajukan FREEBSD di indonesia.
## Sangat Bermanfaat ##
FREEBSD Only
Waah..saya sangat senang sekali jika tulisan saya bermanfaat. Mudh-mudahan saya bisa terus menulis dan saya juga berharap bapak pun menulis tentang freebsd untuk kemajuan freebsd indonesia. Tetap semangat !!!