FreeBSD 上的 SNMP

自從 bsnmpd 進 base 後,在 上要做流量統計所需要做的事情愈來愈簡單了。

首先是修改 /etc/rc.conf,開機時會自動跑 bsnmpd:

bsnmpd_enable="YES"

第一次啟動時可以手動跑:

# /etc/rc.d/bsnmpd start

然後裝

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

裝完後跑 cfgmaker 產生檔案:

# cfgmaker public@127.0.0.1 > mrtg.cfg

然後修改 mrtg.cfg 內的 WorkDir,最後產生 index.html:

# indexmaker mrtg.cfg > index.html

然後將 mrtg 指令放到 crontab 裡跑就可以了。

This entry was posted in Computer, FreeBSD, Murmuring, Network, OS. Bookmark the permalink.

3 Responses to FreeBSD 上的 SNMP

  1. Ericzhao82 says:

    老大,我的怎么没跑起来呢??

    [vpn.via.com /var/log #]uname -r
    6.2-RELEASE
    [vpn.via.com /var/log #]cat /etc/rc.conf | grep bsnmpd
    bsnmpd_enable="YES"
    [vpn.via.com /var/log #]/etc/rc.d/bsnmpd start
    Starting bsnmpd.
    [vpn.via.com /var/log #]ps aux | grep -i "bsnmpd"
    [vpn.via.com /var/log #]cfgmaker zhaol@freebsder.info > mrtg.cfg
    SNMP Error:
    no response received
    SNMPv1_Session (remote host: "freebsder.info" [69.25.27.171].161)
    community: "zhaol"
    request ID: -1246787500
    PDU bufsize: 8000 bytes
    timeout: 2s
    retries: 5
    backoff: 1)
    at /usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm line 627
    SNMPWALK Problem for 1.3.6.1.2.1.1 on zhaol@freebsder.info::::::v4only
    at /usr/local/bin/cfgmaker line 918
    WARNING: Skipping zhaol@freebsder.info: as no info could be retrieved

  2. bsnmpd 預設只會聽 127.0.0.1。

  3. Pingback: 小惡魔電腦技術 - AppleBOY’s Blog » Blog Archive » [FreeBSD] SNMP 統計流量分析 mrtg

Leave a Reply

Your email address will not be published. Required fields are marked *