麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 服務器 > Win服務器 > 正文

在WINDOWS下安裝MRTG全攻略

2024-09-10 00:01:20
字體:
來源:轉載
供稿:網友

在WINDOWS下安裝MRTG全攻略
網絡流量監控
文:重慶/樊禮 ([email protected])
如需轉載,請保持文檔完整并注明出處(
http://www.cnitexam.com )
代序
在一個網絡中,作為網絡工程師或者網絡管理員,需要隨時了解網絡的各種狀態,以判斷網絡是否處于健康狀態或者隨時了解網絡的流量、每個路由器的流量、每個交換機端口的流量…,以供年度報告時向上級領導提供詳實的數據及圖形報告。在這里,我先把自己有關如何獲取網絡流量的方法向大家講解一下,如果有必要,您可以立即動手,自己做一個公司的網絡流量監控圖出來。網絡流量的監控需要涉及到SNMP、PERL、MRTG和一點網頁的相關知識,現在我就STEP BY STEP給大家講解怎么具體實施。我的水平有限,如有錯誤或者更好的解決辦法,還懇請大家提出,謝謝!

STEP BY STEP教您安裝PERL
Perl的安裝比較簡單了,目前使用的一般是Active Perl for windows,現在最新的版本是5.8.0,它需要使用者先安裝IIS或者APACHE等常用的WEB服務器平臺。在這里,我就以最常用的IIS作為安裝的示例,如果大家需要在APACHE平臺里面安裝PERL,結果會稍有些不同.
Perl 適用于五花八門的各種作業平臺, 包括所有已知的 UNIX/Linux
及微軟的作業系統, 以及足夠支持 POSIX 的下列平臺: BeOS, Cygwin, Netware,MPE/iX, OS/2, QNX, VMS, VOS, 以及 z/OS. 麥金塔 MacOS Classic 的用戶也可以在http://dev.macperl.org/ 下載專屬的移植版本.
在本例子中,我們以ActivePerl-5.6.1作為安裝示例教大家怎么安裝,Perl For WINDOWS 版本是msi的安裝包,一般的情況如ActivePerl-5.6.1.633-MSWin32-x86.msi ,大家可以去http://downloads.activestate.com/Ac...MSWin32-x86.msi 下載最新版本的ActivePerl。
安裝Perl的過程很簡單的,但還是要講解一下:
我現在的環境是WINDOWS 2000 SERVER 英文版+PACK3 ,IIS5.0平臺。
1、 打開Perl的安裝文件 ,點下一步,


2、 沒得選擇,只有同意協議才能下一步。

3、 在這里千萬要注意了,系統默認是安裝在 Perl 目錄里面,但為了我們以后使用程序的方便,一定要記得修改為 usr 目錄,盤符一般應和web的根目錄所在的盤一致,結果如下:

4、 下一個畫面會讓您確認是否使用[PPM3發送個人信息至ASPN],還是省著點兒,不要選它,直接按下一步。
5、 這里可以全部選擇上,下一步。

6、 提示準備好了開始安裝了,下一步。
7、 開始安裝

8、 硬盤一陣狂響之后,系統就安裝成功了!大概在等幾分鐘吧
9、 安裝Perl 到此結束,是不是超級簡單。
Perl安裝好之后,您可以打開 [Internet Information Services]->[Default WebSite]->[Properties]->[Home Directory]->[Configuration]看到如下的畫面

看到其中有pl,plx,就表示安裝成功了,其他.cgi的是我自己手工加上去的,方法是點擊其他的[Add…]

在出現的對話框中輸入如圖所示的字符串即可。

然后我們可以測試一下安裝的結果,一般使用所謂的CGI探針,可以在網上找到。出現如上圖所示的內容,就表示我們的PERL安裝配置成功,可以進入下一步學習了。

STEP BY STEP教您設置SNMP
我們將PERL安裝好后,要先設置一下您需要監控流量的設備,它可能是路由器、交換機…甚至于一臺安裝了WIN2K的電腦。只要其支持SNMP的traps,都可以使用來作用被監控的對象。我在這里面以一臺CISCO 2950交換機和華為2600路由器為例給大家介紹,因為涉及到IOS版本和其他不確定因素,在實際操作中,希望大家靈活運用。當然,下面的例子是我親手調試通過的,您只需要改變一下相關名稱,就可以正常使用了。
為了方便大家閱讀,我簡單的解釋一下:在設置community 字串時,不要使用默認的public,因為它無容易被某些黑客監聽,或者出現安全漏洞,可以選擇自己認為有意義的字符串;host是接收traps的主機IP名字,可以根據您的實際需要調整。
以下命令在CISCO 2950環境里面調試通過:
C: elnet 您的交換機的IP
User Access Verification
Password:
TNKSW>en
Password:
TNKSW# conf t
TNKSW(config)# nmp-server community chinatnk RO
TNKSW(config)# snmp-server trap-source FastEthernet0/1
TNKSW(config)# snmp-server contact
[email protected]
TNKSW(config)# snmp-server host 192.168.0.6 chinatnk
TNKSW(config)# snmp-server enable traps
TNKSW# sh run
TNKSW# wr
(以下為部份摘錄show run命令)
……

……
可以看到,到此我們的交換機的SNMP已經正常工作了,當然,最重要的是別忘了保存呀,要不然就前功盡棄了,呵呵…
再看看華為2600路由器的配置,其實也差不多的,不過華為的產品好象幾個命令的CISCO有些不一樣,^_^
C: elnet 您的交換機的IP
User Access Verification
Password:
qjrouter> en
Password:
qjrouter# conf (華為產品不帶terminal參數,*_*)
qjrouter(config)#snmp-server ?
community Enable SNMP ; set community string
contact Text for mib object sysContact
enable Enable SNMP Traps
host Specify hosts to receive SNMP TRAPs
location Text for mib object sysLocation
trap-authentication Send TRAP on receipt of incorrect community string
qjrouter(config)#snmp-server enable traps
qjrouter(config)#snmp-server contact
[email protected]
qjrouter(config)#snmp-server location chinatnk
qjrouter(config)#snmp-server community ?
ro Read-only access with this community string
rw Read-Write access with this community string
qjrouter(config)#snmp-server community ro chinatnk
qjrouter(config)#
qjrouter#wr
qjrouter#sh ru
(以下為部份摘錄show run命令)
……
……
友情提示:一定要保存,不要忘記了,^_^


STEP BY STEP教您安裝MRTG
我們首先要從Internet上面下載最新的MRTG回來,MRTG的官方網址是:http://people.ee.ethz.ch/~oetiker/webtools/mrtg/ MRTG的中國鏡象網址是:http://mrtg.openunion.org/ MRTG的下載網址是:http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ ,現在最新的版本是:mrtg-2.9.27.zip 如果您使用的是LINUX或者UNIX系統,可以直接下載mrtg-2.9.27.tar.gz 。軟件下載回來后,我們要先將其解壓。由于MRTG是一個PERL寫的程序,不需要安裝,稍后有些安裝過程需要在DOS里面完成,所以建議解壓的路徑為C:MRTG。
下面給出詳細的安裝步驟:
1、 運行cmd,進入DOS狀態;
2、 c:>cdmrtgin 進入剛才解壓的MRTG目錄,準備執行命令;
3、 使用perl mrtg 命令測試MRTG是否正確;
4、 執行命令行perl cfgmaker
[email protected] --global "WorkDir: c:wwwmrtg" --output mrtg.cfg
這一行命令我要解釋一下:
[email protected] 使用的是您需要獲得SNMP數據的設備的community 和它的IP地址;
WorkDir: c:wwwmrtg 使用的是正確安裝MRTG后,需要使用到的WEB目錄,要根據實際情況更改;
output mrtg.cfg 則是輸出后的配置文件名稱;
改好了之后按一下回車,系統就開始執行配置了。由于我是先使用的是交換機來作為的SNMP源,上面命令執行后,它會綁定24個端口,有一些信息顯示出來,而路由器上沒有那么多需要綁定的端口,所以信息量會稍微少一些。
此一步驟正常執行完后,系統將在MRTG的目錄下生成指定的mrtg.cfg文件,我們下一步要做的就是修改MRTG文件,使之符合我們的要求。
有的設備不支持SNMP協議,在這里將會出現錯誤的提示信息,請各位朋友注意一下。
注意,如果您是需要同時監控多個設備的流量,則需要修改output 參數后面的配置文件名,此例中是mrtg.cfg。
詳細資料如下:
C:mrtgin>perl cfgmaker
[email protected] --global "WorkDir: e:webrootmrt
g" --output mrtg4.cfg
--base: Get Device Info on
[email protected]:
--base: Vendor Id: cisco
--base: Populating confcache
--snpo: confcache
[email protected]: Name Fa0/1 --> 1
--snpo: confcache
[email protected]: Name Fa0/2 --> 2
--snpo: confcache
[email protected]: Name Fa0/3 --> 3
--snpo: confcache
[email protected]: Name Fa0/4 --> 4
--snpo: confcache
[email protected]: Name Fa0/5 --> 5
--snpo: confcache
[email protected]: Name Fa0/6 --> 6
--snpo: confcache
[email protected]: Name Fa0/7 --> 7
--snpo: confcache
[email protected]: Name Fa0/8 --> 8
--snpo: confcache
[email protected]: Name Fa0/9 --> 9
--snpo: confcache
[email protected]: Name Fa0/10 --> 10
--snpo: confcache
[email protected]: Name Fa0/11 --> 11
--snpo: confcache
[email protected]: Name Fa0/12 --> 12
--snpo: confcache
[email protected]: Name Fa0/13 --> 13
--snpo: confcache
[email protected]: Name Fa0/14 --> 14
--snpo: confcache
[email protected]: Name Fa0/15 --> 15
--snpo: confcache
[email protected]: Name Fa0/16 --> 16
--snpo: confcache
[email protected]: Name Fa0/17 --> 17
--snpo: confcache
[email protected]: Name Fa0/18 --> 18
--snpo: confcache
[email protected]: Name Fa0/19 --> 19
--snpo: confcache
[email protected]: Name Fa0/20 --> 20
--snpo: confcache
[email protected]: Name Fa0/21 --> 21
--snpo: confcache
[email protected]: Name Fa0/22 --> 22
--snpo: confcache
[email protected]: Name Fa0/23 --> 23
--snpo: confcache
[email protected]: Name Fa0/24 --> 24
--snpo: confcache
[email protected]: Name Nu0 --> 25
--snpo: confcache
[email protected]: Name Vl1 --> 26
--snpo: confcache
[email protected]: Descr FastEthernet0/1 --> 1
--snpo: confcache
[email protected]: Descr FastEthernet0/2 --> 2
--snpo: confcache
[email protected]: Descr FastEthernet0/3 --> 3
--snpo: confcache
[email protected]: Descr FastEthernet0/4 --> 4
--snpo: confcache
[email protected]: Descr FastEthernet0/5 --> 5
--snpo: confcache
[email protected]: Descr FastEthernet0/6 --> 6
--snpo: confcache
[email protected]: Descr FastEthernet0/7 --> 7
--snpo: confcache
[email protected]: Descr FastEthernet0/8 --> 8
--snpo: confcache
[email protected]: Descr FastEthernet0/9 --> 9
--snpo: confcache
[email protected]: Descr FastEthernet0/10 --> 10
--snpo: confcache
[email protected]: Descr FastEthernet0/11 --> 11
--snpo: confcache
[email protected]: Descr FastEthernet0/12 --> 12
--snpo: confcache
[email protected]: Descr FastEthernet0/13 --> 13
--snpo: confcache
[email protected]: Descr FastEthernet0/14 --> 14
--snpo: confcache
[email protected]: Descr FastEthernet0/15 --> 15
--snpo: confcache
[email protected]: Descr FastEthernet0/16 --> 16
--snpo: confcache
[email protected]: Descr FastEthernet0/17 --> 17
--snpo: confcache
[email protected]: Descr FastEthernet0/18 --> 18
--snpo: confcache
[email protected]: Descr FastEthernet0/19 --> 19
--snpo: confcache
[email protected]: Descr FastEthernet0/20 --> 20
--snpo: confcache
[email protected]: Descr FastEthernet0/21 --> 21
--snpo: confcache
[email protected]: Descr FastEthernet0/22 --> 22
--snpo: confcache
[email protected]: Descr FastEthernet0/23 --> 23
--snpo: confcache
[email protected]: Descr FastEthernet0/24 --> 24
--snpo: confcache
[email protected]: Descr Null0 --> 25
--snpo: confcache
[email protected]: Descr Vlan1 --> 26
--snpo: confcache
[email protected]: Ip 192.168.0.4 --> 26
--snpo: confcache
[email protected]: Type 6 --> 1
--snpo: confcache
[email protected]: Type 6 --> 2 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 3 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 4 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 5 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 6 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 7 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 8 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 9 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 10 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 11 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 12 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 13 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 14 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 15 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 16 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 17 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 18 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 19 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 20 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 21 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 22 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 23 (duplicate)
--snpo: confcache
[email protected]: Type 6 --> 24 (duplicate)
--snpo: confcache
[email protected]: Type 1 --> 25
--snpo: confcache
[email protected]: Type 53 --> 26
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-81 --> 1
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-82 --> 2
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-83 --> 3
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-84 --> 4
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-85 --> 5
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-86 --> 6
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-87 --> 7
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-88 --> 8
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-89 --> 9
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-8a --> 10
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-8b --> 11
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-8c --> 12
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-8d --> 13
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-8e --> 14
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-8f --> 15
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-90 --> 16
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-91 --> 17
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-92 --> 18
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-93 --> 19
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-94 --> 20
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-95 --> 21
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-96 --> 22
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-97 --> 23
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-98 --> 24
--snpo: confcache
[email protected]: Eth --> 25
--snpo: confcache
[email protected]: Eth 00-0b-be-b2-b8-80 --> 26
--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Walking ifAlias
--base: Walking ifSpeed
--base: Writing mrtg4.cfg
C:mrtgin>perl mrtg mrtg4.cfg
C:mrtgin>
C:mrtgin>perl cfgmaker
[email protected] --global "WorkDir: e:webrootm
rtg" --output mrtg5.cfg
--base: Get Device Info on
[email protected]:
--base: Vendor Id:
--base: Populating confcache
--snpo: confcache
[email protected]: Descr Ethernet0 --> 1
--snpo: confcache
[email protected]: Descr Serial0 --> 2
--snpo: confcache
[email protected]: Descr Bri0 --> 3
--snpo: confcache
[email protected]: Descr LoopBack0 --> 4
--snpo: confcache
[email protected]: Ip 127.0.0.1 --> 4
--snpo: confcache
[email protected]: Ip 192.168.0.254 --> 1
--snpo: confcache
[email protected]: Ip 202.104.141.177 --> 1
--snpo: confcache
[email protected]: Type 6 --> 1
--snpo: confcache
[email protected]: Type 23 --> 2
--snpo: confcache
[email protected]: Type 23 --> 3 (duplicate)
--snpo: confcache
[email protected]: Type 24 --> 4
--snpo: confcache
[email protected]: Eth 00-e0-fc-06-d4-21 --> 1
--snpo: confcache
[email protected]: Eth 00-00-00-00-00-00 --> 2
--snpo: confcache
[email protected]: Eth 00-00-00-00-00-00 --> 3 (duplicate
)
--snpo: confcache
[email protected]: Eth 00-00-00-00-00-00 --> 4 (duplicate
)
--base: Get Interface Info
--base: Walking ifIndex
--base: Walking ifType
--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Walking ifSpeed
--base: Writing mrtg5.cfg
C:mrtgin>perl mrtg mrtg5.cfg
C:mrtgin>
5、 開始生成流量圖及配置文件
6、
C:mrtgin>perl mrtg mrtg.cfg
命令成功執行完成后,將會在我們前一個命令所指定的WEB目錄里面生成以IP+端口命名的網頁和一些png圖片,這些圖片就是網絡當時的流量圖。我們可以直接打開這個網頁檢查一下,看是否正常。剛開始生成后很多都是空白的,需要讓它自動運行一段時間后才可以有圖形表現出來。
7、 要使MRTG可以隨時得到最新的流量圖,我們還需要修改一下配置腳本,主要是剛才output參數所帶的文件名mrtg.cfg,使用文本編輯器打開它。
文件頭部已經說明了在Windows系統里面或者在UNIX系統里面的不同配置方法,現在因為是新版的MRTG,已經自動在尾部添加了工作目錄,不需要我們再手工編輯。
為了使網絡流量圖可以每5分鐘自動更新一次,我們還需要在
###Global Config Options的下一行加入一條命令:
RunAsDaemon: yes
這條命令的作用是使MRTG每5分鐘自動去獲取一次SNMP的數據及更新網絡流量圖形。
保存文件,退出。
8、 當我們需要同時監控的設備多于一個時或者設備的接口多于一個時,將會涉及到生成了多個配置文件,這樣查看起來比較困難,這時我們需要使用indexmaker命令將多個數據收集起來做成一個文件里面。
執行如下命令:
C:MRTGBIN> perl indexmaker --output=index.htm mrtg.cfg
此時,系統將會自動生成index.htm在我們指定的WEB目錄里面,我們現在可以打開網頁文件來查看是否正常了。
9、 為了使系統在每次開機后,能自動運行該命令,我們還需要在啟動里面加入這個快捷方式。
1)、在桌面擊右鍵,選擇快捷方式。
2)、輸入快捷方式的運行命令行為 start /D c:mrtg/bin wperl mrtg

主站蜘蛛池模板: 久久草在线视频国产 | 亚洲视频在线网 | 蜜桃欧美性大片免费视频 | 国产成人精品免高潮在线观看 | 成人综合一区二区 | 全网免费毛片 | 91午夜视频| 成人性视频免费网站下载软件 | 欧美一级电影网 | 国产午夜精品一区二区三区视频 | 中文字幕激情视频 | 农村少妇吞精夜夜爽视频 | 久久思思爱 | 久久久国产视频 | 天天操天天碰 | 国产成人羞羞视频在线 | 成人精品久久久 | 国产精品午夜小视频观看 | 久久久久久久久久91 | 久久久久九九九女人毛片 | 欧美成网站 | 一级色毛片 | 午夜看毛片 | 亚洲第一页视频 | 国产免费观看一区二区三区 | 久久在线 | 三级xxxx| 亚洲国产资源 | 国产1区2区3区中文字幕 | 久久国产精品91 | 成人在线网站 | 国产一区视频免费观看 | 国产精品久久久久久久四虎电影 | 国产精品999在线观看 | 美女擦逼| 久久久久久久久久网站 | 国产99久久久国产精品下药 | 亚洲福利在线观看视频 | 日本教室三级在线看 | 日韩精品久久久久久 | 99日韩精品视频 |