SNMP MRTG A 0943359 20080620 SNMP Simple Network

  • Slides: 17
Download presentation
SNMP -以MRTG實作 A 0943359 魏兆言 2008/06/20

SNMP -以MRTG實作 A 0943359 魏兆言 2008/06/20

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

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

SNMP 基本架構 • Use UDP SNMP 成員: • SNMP 管理者 (SNMP Manager) • SNMP

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

SNMP 版本

SNMP 版本

MIB 簡介 • Management Information Base • 透過 SNMP 去 query MIB • 不同廠商有不同的

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

MIB II 結構 • OID: 1. 3. 6. 1. 2. 1 • Full path:

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

MIB II – Windows Broswer

MIB II – Windows Broswer

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

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

1. Install MRTG Base on ubuntu 7. 10 Linux • apt-get install apache 2

1. Install MRTG Base on ubuntu 7. 10 Linux • apt-get install apache 2 • apt-get install mrtg • apt-get install snmpd

2. Edit snmpd. conf • Edit snmpd: vim /etc/snmpd. conf • • #sec. name

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

Restart & Create • restart snmp: /etc/init. d/snmpd restart • create mrtg setting file:

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

Plugin - 建立RAM偵測項目 • mkdir /opt/mrtg vim /opt/mrtg. ram #!/bin/bash # run this script

Plugin - 建立RAM偵測項目 • mkdir /opt/mrtg vim /opt/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. ram

加入RAM項目 Target[ram]: `/opt/mrtg. ram` #Unscaled[ram]: dwym Max. Bytes[ram]: 2048000 Title[ram]: Memory Short. Legend[ram]: &

加入RAM項目 Target[ram]: `/opt/mrtg. ram` #Unscaled[ram]: dwym Max. Bytes[ram]: 2048000 Title[ram]: Memory Short. Legend[ram]: & kmg[ram]: k. B, MB kilo[ram]: 1024 YLegend[ram]:   Memory Usage : Legend 1[ram]:   Total Memory : Legend 2[ram]:   Used Memory : Legend. I[ram]:   Total Memory : Legend. O[ram]:   Used Memory : Options[ram]: growright, gauge, nopercent Page. Top[ram]: <H 1>Memory</H 1>

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

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

THE END

THE END