以下介紹一個小巧免安裝的免費SNMP 流量監測軟體和一個提供免費即時監測服務的網站:
使用免費即時監控, 請記得變更預設R/O 和R/W Community 密碼
【軟體】Paessler PRTG Traffic Grapher (免費版可監控10 個介面)
以下介紹一個小巧免安裝的免費SNMP 流量監測軟體和一個提供免費即時監測服務的網站:
使用免費即時監控, 請記得變更預設R/O 和R/W Community 密碼
【軟體】Paessler PRTG Traffic Grapher (免費版可監控10 個介面)
覺得Cacti 太高深的話, 那就請試試STG, 此外, DD-WRT & OpenWrt 玩家更是應該仔細研究一下, 以下介紹幾篇文章供網友參考, 小弟自己也才剛接觸OpenWrt, 所以還不知道該如何運用, 不過對於想要學習管理網路的網友來說, 這條路是早晚要走的, 請先把STG 當作入門練習, 等熟悉後不妨先試試Paessler PRTG Traffic Grapher, 然後再考慮進階到Cacti
至於OpenWrt snmpd 套件, 建議安裝snmpd-static, 這套只需要安裝libelf, 所以檔案比較小, 而snmpd 則需要libnetsnmp
DD-WRT Forum :: View topic - Super simple SNMP traffic graph - for dummies!!!
DD-WRT Forum :: View topic - SNMP OID for Active IP Connections?
OpenWrt / How to find the number of Wifi Client through SNMP ??!!
STG - SNMP Traffic Grapher - SNMP Informant (含STG + GetIf 打包下載)
Seednet FTTB 10M/2M DHCP取得IP 高雄 - PCZONE 討論區 #12 & #14
此文章於 2010-04-20 08:16 AM 被 FYI 編輯。
剛入門的網友可能還是不知道該如何進行, 那就請看以下監看TECOM AR4031B/C 下載/上傳流量的步驟:
以瀏覽器登入TECOM AR4031B/C
- 點選Management -> SNMP Agent
- SNMP Agent: Enable
- Read Community: public
- Trap Manager IP: 主控PC's IP
- 點擊Save/Apply
- Save/Reboot
執行Getif
- Parameters -> Host name 輸入Modem's IP, 例如192.168.1.1
- 點擊Start, 若SysName 並未顯示Modem 名稱, 則請回到前一步驟檢查Modem's SNMP Agent 設定
- 點擊Interfaces, 再點擊Start, 撥接用戶請檢查descr: ppp_0_33_1 或ppp_0_34_1 的int 編號, 通常為8, 非撥接用戶請檢查descr: dsl0 的int 編號, 通常為4, 以上就是WAN 的介面編號
- 點擊MBrowser, 再點擊Start, 數秒鐘後按Stop
- 第一行輸入 ".iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifInOctets", 再點擊Start, 於中間下方視窗找到 "interfaces.ifTable.ifEntry.ifInOctets.<介面編號>", 例如 "interfaces.ifTable.ifEntry.ifInOctets.8", 點擊一下, 則左下角出現的OID 編號代表下載流量
- 同上, 第一行輸入 ".iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets", 再點擊Start, 於中間下方視窗找到 "interfaces.ifTable.ifEntry.ifOutOctets.<介面編號>", 例如 "interfaces.ifTable.ifEntry.ifOutOctets.8", 點擊一下, 則左下角出現的OID 編號代表上傳流量
執行STG
- 點選View -> Settings
- Target Address: 輸入Modem's IP, 例如192.168.1.1
- Community: public
- "Green" OID: 輸入代表下載 (In) 的OID, 例如 "1.3.6.1.2.1.2.2.1.10.8" (通常為8 或4)
- "Blue" OID: 輸入代表上傳 (Out) 的OID, 例如 "1.3.6.1.2.1.2.2.1.16.8" (通常為8 或4)
- OK
- 點擊View -> Start 或功能鍵F7, 開始統計
- 點擊View -> Stop 或功能鍵F8, 停止統計
- 某些非增量的數值, Getif 會於MBrowser -> Type 標示為 "gauge", 例如下載頻寬 "ifSpeed (1.3.6.1.2.1.2.2.1.5.4)", 請於步驟2 對應的OID 勾選 "Gauge", 屬於增量的Type 則標示為 "counter", 請勿勾選 "Gauge", 請勿統計以上兩種以外型態的數值
- 請勿同時顯示兩種不同單位的OID, 否則其一可能很難觀察其變化
SNMP4tPC - The Getif SNMP Utility
只要懂得下指令, 就能夠透過SNMP 傳送任何數據
OpenWrt / Wireless Macaddress Forwarding
GOOD...........
小弟以Getif 讀取OpenWrt 的Parameters, 奇怪竟然會沒顯示系統資訊, 以Packetyzer 檢查, 起先完全看不懂錯誤訊息所代表的意義:
可是執行snmpwalk 可以顯示很多訊息啊! 再比對snmpget 和snmpgetnext 的輸出, 差一點還讓小弟誤以為OpenWrt 的snmpd 套件不支援PDU type: GET (0):語法:Error Status: NO SUCH NAME (2) Error Index: 7 Object identifier 1: 1.3.6.1.2.1.1.1.0 (SNMPv2-MIB::sysDescr.0) Value: NULL Object identifier 2: 1.3.6.1.2.1.1.2.0 (SNMPv2-MIB::sysObjectID.0) ...(43) Object identifier 7: 1.3.6.1.2.1.1.7.0 (SNMPv2-MIB::sysServices.0)
沒辦法只好開始翻閱文件, 從 "Manpage of SNMPGET" 看到 "Manpage of SNMPCMD", 最後在 "Manpage of SNMPD.CONF - System Group" 一節, 比對小弟照抄 "/packages/net/net-snmp/files/snmpd.conf – OpenWrt" 的部份, 還是看不出問題為何, 但看了這三篇和先前所看過的 "Manpage of SNMPWALK" 和 "Manpage of SNMPGETNEXT" 之後, 所謂 "臨陣磨槍, 不亮也光", 終於讓小弟有能力回頭檢視snmpget 錯誤訊息所代表的意義, 既然snmpget 會單獨挑出錯誤之處, 那麼Packetyzer 應該也會顯示才對啊! 於是再仔細研究封包內容, 是否 "Error Index: 7" 代表 "第七個什麼東東" 有問題呢? 既然不知道答案為何, 那就把Getif 所送出的封包拆解成多個snmpget 指令, 最後才確定 "sysServices.0" 有問題, 這也正是Getif 所詢問的 "第七個" 參數, 接著檢視/etc/conf/snmpd:語法:C:\usr\bin>snmpget -v1 -Cf -c public 192.168.1.254 system.sysUpTime system.sysContact.0 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: SNMPv2-MIB::sysUpTime C:\usr\bin>snmpgetnext -v1 -Cf -c public 192.168.1.254 system.sysUpTime system.sysContact.0 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (114090) 0:19:00.90 SNMPv2-MIB::sysName.0 = STRING: HeartOfGold
看起來很正常, 再檢查/etc/init.d/snmpd:語法:config system option sysLocation 'office' option sysContact '[email protected]' option sysName 'HeartOfGold' # option sysServices 72 option sysDescr 'adult playground' # option sysObjectID '1.2.3.4'
這才發現 "$sysservice" 和 "sysService" 好像都少了 "s", 補上之後, 重新執行:語法:snmpd_system_add() { local cfg="$1" config_get syslocation "$cfg" sysLocation [ -n "$syslocation" ] && echo "sysLocation $syslocation" >> $RUN_C config_get syscontact "$cfg" sysContact [ -n "$syscontact" ] && echo "sysContact $syscontact" >> $RUN_C config_get sysname "$cfg" sysName [ -n "$sysname" ] && echo "sysName $sysname" >> $RUN_C config_get sysservice "$cfg" sysService [ -n "$sysservice" ] && echo "sysService $sysservice" >> $RUN_C config_get sysdescr "$cfg" sysDescr [ -n "$sysdescr" ] && echo "sysDescr $sysdescr" >> $RUN_C config_get sysobjectid "$cfg" sysObjectID [ -n "$sysobjectid" ] && echo "sysObjectID $sysobjectid" >> $RUN_C
然後檢查/etc/snmp/snmpd.conf:語法:/etc/init.d/snmpd restart
終於有 "小s" 了! 再執行:語法:sysServices 72
沒有錯誤訊息, 再以Getif 讀取OpenWrt 的Parameters, 至此總算完全正確語法:C:\usr\bin>snmpget -v1 -Cf -c public 192.168.1.254 sysServices.0 SNMPv2-MIB::sysServices.0 = INTEGER: 72
OpenWrt / Typo in /packages/net/net-snmp/files/snmpd.init
感謝琥珀兄的提示, #3 SNMP4tPC - The Getif SNMP Utility 之中雖然有提到SNMP Informant, 不過由於目的不同, 所以當時並未引起小弟的注意, 小弟先前所提供的連結主要針對網路而言, 然而如果目標是Windows 效能統計, 那麼SNMP Informant-Standard 加上Getif 將會是不錯的組合, 記得還得下載MIBs 以供Getif 讀取
SNMP Informant - Free AgentsSNMPLink.org - End-User SNMP Software
Display SNMP Informant-Std OID TreeSNMP Informant-Standard allows you to access data from the "Core Four" performance counters (logical disk, processor, memory and network interface), and allows you to begin monitoring them on any Windows 2000/XP/Vista/2003 system you want. As a bonus, we even threw in support for Object\Processes and Object\Threads! Click the button below for a tree listing that shows all the counters (objects and instances) you can access using SNMP Informant-Std.
ByteSphere's MIB Download Area
書籤