Bikin MRTG

July 10, 2007 by eko-saputro

Dikarenakan ada teman yang meminta artikel membuat MRTG di Linux akhirnya gw tulis deh, sebelumnya siapkan hati dan pikiran anda he.he..he.. , ok lansung aja caranya seperti ini :


Requierment :



  1. Install snmpd

  2. Install apache

  3. Install gcc



  1. Install SNMP ( kalo di Suse lewat yast aja )

  2. Config file /etc/snmp.conf seperti di bawah ini :

  3. syslocation Router ( nama router anda )

    syscontact Sysadmin (root@localhost)

    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


  4. Jalankan snmp nya #/etc/init.d/snmpd start

  5. Download dan compile software2 ini :



  1. Buat direktori penampung dulu yah :

  2. # mkdir -p /usr/local/src

    # cd /usr/local/src


  3. Installed zlib

  4. # wget http://www.gzip.org/zlib/zlib-1.1.4.tar.gz

    # gunzip -c zlib-1.1.4.tar.gz | tar xf -

    # rm zlib-1.1.4.tar.gz

    # mv zlib-1.1.4 zlib

    # cd zlib

    # ./configure

    # make

    # cd ..


  5. Installed libpng

  6. # wget http://public.planetmirror.com/pub/sourceforge/l/li/libpng/libpng-1.0.15.tar.gz

    # gunzip -c libpng-1.0.15.tar.gz |tar xf -

    # rm libpng-1.0.15.tar.gz

    # mv libpng-1.0.15 libpng

    # cd libpng

    # make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib

    # rm *.so.* *.so

    # cd ..


  7. Compile gd

  8. # wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz

    # gunzip -c gd-2.0.11.tar.gz |tar xf -

    # mv gd-2.0.11 gd

    # cd gd

    # env CPPFLAGS=”-I../zlib -I../libpng” LDFLAGS=”-L../zlib -L../libpng” ./configure –disable-shared –without-freetype –without-jpeg

    # make

    # cp .libs/* .

    # perl -i~ -p -e s/gd_jpeg.o//g Makefile make INCLUDEDIRS=”-I. -I../zlib -I../libpng” LIBDIRS=”-L../zlib -L. -L../libpng” LIBS=”-lgd -lpng -lz -lm” CFLAGS=”-O -DHAVE_LIBPNG”

    # cd ..


  9. Compilation MRTG ( Download MRTG simpan di /usr/local/src )

  10. # cd /usr/local/src

    # gunzip -c mrtg-2.14.4.tar.gz | tar xvf -

    # mv mrtg-2.14.4 mrtg-2

    # cd mrtg-2

    # ./configure –prefix=/usr/local/mrtg-2 –with-gd=/usr/local/src/gd –with-z=/usr/local/src/zlib –with-png=/usr/local/src/libpng

    # make

    # make install


  11. Configuration MRTG

  12. # /usr/local/mrtg-2/bin/cfgmaker –global ‘WorkDir: /srv/www/htdocs/mrtg’ –global ‘Options[_]: bits,growright’ –output /srv/www/htdocs/mrtg/cfg/mrtg.cfg public@localhost


    note : /srv/www/htdocs adalah tempat direktori utama peyimpanan dokumen web ( sesuaikan dengan Config apache anda, sebelumnya buat dulu direktori mrtg di /srv/www/htdocs dan direktori cfg di /srv/www/htdocs/mrtg )




  1. Jalankan MRTG

  2. # /usr/local/mrtg-2/bin/mrtg /srv/www/htdocs/mrtg/cfg/mrtg.cfg


  3. Masukin konfigurasi ini di mrtg.cfg

    - Agar automatis start :

    RunAsDaemon : Yes

    - Agar update tiap 5 menit :

    Interval : 5

    - Agar auto refresh pada web browser :

    Refresh : 300M

  4. Buat indexmaker

  5. # /usr/local/mrtg-2/bin/indexmaker /srv/www/htdocs/mrtg/cfg/mrtg.cfg > /srv/www/htdocs/mrtg/index.html


Filed under having  

0 komentar:

'http://infintyskins.blogspot.com/'>