[FreeBSD] SNMP and MRTG on FreeBSD 7

| 五月 28, 2008 | 沒有迴響 | 沒有引用 | 1681 reads | Size: L, M, S | Edit: P, C |
| Category: Server. and Tags: , , . |

    日前升級到 FreeBSD 7 才發現原本的 MRTG 設定檔不會跑了,研究一下,才知道 SNMPd 被並進 BSD 裡面,改名叫做 BSNMPd。

    因為併進來了,啟用就簡單了!編輯 /etc/rc.conf,加上

    bsnmpd_enable="YES"

    之後就會自己開始跑了。要立刻開始跑,可以打:

    /etc/rc.d/bsnmpd start

    然後就是安裝一下 MRTG:

    # cd /usr/ports/net-mgmt/mrtg
    # make install clean

    接著產生 config:

    # cfgmaker  --global 'WorkDir: /usr/local/www/apache22/data/mrtg'  --global 'Options[_]: growright, bits'  --global 'WithPeak[_]: wmy'  public@localhost  >  /usr/local/etc/mrtg/mrtg.cfg

    產生 Index:

    # indexmaker  --title 'MRTG'  --addhead='<meta http-equiv="Content-Type" content="text/html; charset=big5">'  --output /usr/local/www/apache22/data/mrtg/index.html  --columns=1  --nolegend  /usr/local/etc/mrtg/mrtg.cfg

    接著跑跑看:

    mrtg /usr/local/etc/mrtg/mrtg.cfg

    沒有問題,就可以丟到 crontab 去跑了。

     

     

    至於 cpu 和 memory 的部份,會以 plugin 的方式出現,不過我還不會用XD


    隨機文章:
    » [FreeBSD] MRTG
    » [FreeBSD] MRTG - 偵測流量、CPU Load、RAM Usage
    » [FreeBSD] phpSysInfo, phpMyAdmin
    » [FreeBSD] sudo
    » [FreeBSD] Apache, MySQL, PHP


Leave A Comment: