MRTG in freebsd

Instalasi MRTG di freebsd dengan menggunakan ports :

1. Install snmp

     root@localhost:# cd /usr/ports/net-mgmt/net-snmp
     root@localhost:# make && make install clean

2. Konfigurasi snmp

    root@localhost:#  cp /usr/local/share/snmp/snmpd.conf.example  \
                             /usr/local/share/snmp/snmpd.conf

    root@localhost:# ee /usr/local/share/snmp/snmpd.conf

    Kemudian ganti beberapa baris berikut ini :
    COMMUNITY menjadi public
    network menjadi network id(contoh:192.168.0.0)

    Jika sudah, kemudian di save.   
    Untuk mengetes apakah konfigurasi kita sudah benar atau belum, gunakan perintah berikut :
    root@localhost:/# snmpd -H

3. Menjalankan snmp dan menjadikannya sebagai startup

    root@localhost:/# /usr/local/etc/rc.d/snmpd start  
    Untuk mengecek apakah snmp sudah berjalan dengan baik gunakan perintah berikut :

    root@localhost:/# pgrep snmpd (jika berhasil maka akan tampil id nya) atau
    root@localhost:/# snmpwalk -v 1 -c public localhost system
    Jika tampil "no response from localhost", periksa kembali konfigurasi snmp-nya.

    Untuk menjalankan snmp secara startup tambahkan perintah berikut kedalam /etc/rc.conf
    snmpd_enable=”YES”
    snmpd_flags=”-a -Lsd -p /var/run/snmpd.pid”

4. Instalasi dan konfigurasi MRTG
    root@localhost:/# cd /usr/ports/net-mgmt/mrtg
    root@localhost:/# make && make install clean 

    root@localhost:/# cfgmaker –global ‘WorkDir: /usr/local/apache/htdocs/web/mrtg’ \
                             –global ‘Options[_]: bits,growright’ \
                             –output /usr/local/etc/mrtg/mrtg.cfg \
                             public@host/ip

    root@localhost:/# indexmaker –output /usr/local/apache/htdocs/web/mrtg/index.html \  
                             /usr/local/etc/mrtg/mrtg.cfg

    root@localhost:/# /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg

    root@localhost:/# crontab -e
    tambahkan line berikut :
    */5 * * * * /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg

5. Jangan lupa untuk menyalakan apachenya..dan buka browserrnya 

    NB: Workdir tergantung kepada documentroot server anda
 

Posted: April 18, 2008

Comments »

The URI to TrackBack this entry is: http://cerdas.blogsome.com/2008/04/18/mrtg-in-freebsd/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.