1 / 17

SNMP

SNMP. - 以 MRTG 實作. A0943359 魏兆言. 2008/06/20. 什麼是 SNMP ?. 簡易網路管理通信協定 (Simple Network Management Protocol) 用途:網路管理 - 透過網路來管理網路設備 - Simple Network Management Protocol. SNMP 基本架構. Use UDP SNMP 成員: SNMP 管理者 (SNMP Manager) SNMP 代理者 (SNMP Agent)

eron
Download Presentation

SNMP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SNMP -以MRTG實作 A0943359 魏兆言 2008/06/20

  2. 什麼是 SNMP ? • 簡易網路管理通信協定 (Simple Network Management Protocol) • 用途:網路管理 - 透過網路來管理網路設備 - Simple Network Management Protocol

  3. SNMP 基本架構 • Use UDP SNMP 成員: • SNMP 管理者 (SNMP Manager) • SNMP 代理者 (SNMP Agent) • (Managed Object):管理訊息資料庫 (MIB)

  4. SNMP 版本

  5. MIB 簡介 • Management Information Base • 透過 SNMP去 query MIB • 不同廠商有不同的 MIB • MIBII (RFC 1213)

  6. MIB II 結構 • OID:1.3.6.1.2.1 • Full path: iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1) • Mib-2: • system • interfaces • at • ip • icmp • tcp • udp • egp • transmission • snmp

  7. MIB II – Windows Broswer

  8. SNMP 用途 • 網路 Topology • 骨幹流量 • 擴充頻寬依據 • 管理策略依據 • 各網路設備設定資料 • 各網路 Server 配置 • 即時監控機制

  9. MRTG MRTG(Multi Router Traffic Grapher) 是一套可用來繪出網路流量圖的軟體, 由Tobias Oetiker與Dave Rand所開發, 此軟體以GPL授權。

  10. MRTG 功能 • 以Perl開發,可跨平臺 • 送出識別碼(OIDs)請求給要查詢的網路設備 - 設備需支援SNMP • 收集到的資料產生HTML檔案 - 以GIF或PNG格式繪製出圖形 • 原本只能繪出網路設備的流量圖 - 發展plug-in - 可監控CPU的負載、記憶體使用狀況等

  11. 1. Install MRTG Base on ubuntu 7.10 Linux • apt-get install apache2 • apt-get install mrtg • apt-get install snmpd

  12. 2. Edit snmpd.conf • Edit snmpd: vim /etc/snmp/snmpd.conf • #sec.name source community • #com2sec paranoid default public • com2sec readonly default public • #com2sec readwrite default private

  13. Restart & Create • restart snmp: /etc/init.d/snmpd restart • create mrtg setting file: cfgmaker public@localhost > /etc/mrtg.cfg • indexmaker: • indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

  14. Plugin - 建立RAM偵測項目 • mkdir /opt/mrtg vim /opt/mrtg/mrtg.ram #!/bin/bash # run this script to check the mem usage. totalmem=`/usr/bin/free |grep Mem |awk ‘{print $2}’` usedmem=`/usr/bin/free |grep Mem |awk ‘{print $3}’` UPtime=`/usr/bin/uptime | awk ‘{print $3“”$4“”$5}’` echo $totalmem echo $usedmem echo $UPtime hostname 更改權限: chmod +755 /opt/mrtg/mrtg.ram

  15. 加入RAM項目 Target[ram]: `/opt/mrtg/mrtg.ram` #Unscaled[ram]: dwym MaxBytes[ram]: 2048000 Title[ram]:Memory ShortLegend[ram]: & kmg[ram]:kB,MB kilo[ram]:1024 YLegend[ram]: &nbsp; Memory Usage : Legend1[ram]: &nbsp; Total Memory : Legend2[ram]: &nbsp; Used Memory : LegendI[ram]: &nbsp; Total Memory : LegendO[ram]: &nbsp; Used Memory : Options[ram]: growright,gauge,nopercent PageTop[ram]:<H1>Memory</H1>

  16. Create index again • 重新產生HTML檔案: indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html DEMO: http://jiaoyen.im.nuk.edu.tw/mrtg/index.html

  17. THE END

More Related