⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nt-guide.html

📁 主要用于监控网络流量并动态产生可视化结果
💻 HTML
字号:
<!DOCTYPE html public "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>The Windows NT Guide to MRTG</TITLE><STYLE type="text/css"> SPAN.c5 {color: #0000FF} P.c4 {color: #0000FF} P.c3 {font-family: Courier} SPAN.c2 {font-size: 150%} H1.c1 {text-align: center}</STYLE></HEAD><BODY bgcolor="#FFFFFF"><H1 class="c1"><STRONG>The Windows NT Guide to MRTG</STRONG></H1><P>by David S. Divins<BR>updated by Steve Pierce, March 1999</P><P><SPAN class="c2">T</SPAN>o get MRTG to work on WindowsNT you needthe following:&nbsp; Latest version MRTG for NT, available <Ahref="pub/">here</A> (look for mrtg-2.8.12.zip or better). The archivedoes also contain a precompiled copy of rateup for 386-NT. Thebinaries for Perl are available <Ahref="http://www.ActiveState.com/">here</A>; and Fiveminute.zip,available <A href="pub/fiveminute.zip">here</A>. This guide is simplya basic overview for NT newbies; for more advanced documentationplease see the mrtg home page.</P><P>Once you have downloaded these four files you are ready tobegin. I suggest you do the following from the machine that will berunning MRTG, which, in this case is also a web server. Allexamples are for doing things to a LOCAL machine.</P><P>First, Unzip MRTG to C:\mrtg-2.8.12 on the WindowsNT machine ofyour choice. Then, unzip fiveminute.zip to the mrtgdirectory.</P><P>Next, extract the Perl files to c:\perl on the same Windows NTmachine. From the command prompt runc:\perl\bin\perlw32-install.bat.&nbsp; Follow the on screeninstructions (choose all the defaults).&nbsp; This will properlyinstall perl with all of the correct path statements. You want yoursystem path statement to look something like this.</P><P>C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%;C:\NTRESKIT;</P><P>You can manually check this by going to ControlPanel/System/Environment</P><P><IMG src="window1.jpg" width="410" height="466"></P><P>&nbsp;</P><P>Now, this step is VERY important! Open the filec:\mrtg-2.8.12\mrtg in your favorite word processor, I suggestMSWord because Word will format the document so it is readable.Once this file is open you need to change lines 4 and 5 from:</P><P class="c3">$main::OS = 'UNIX';</P><P class="c3">#$main::OS = 'NT';</P><P>to</P><P class="c3">#$main::OS = 'UNIX';</P><P class="c3">$main::OS = 'NT';</P><P>This is the only editing you need to do to the actual mrtg file.This simply tells MRTG that your OS is NT. I can not emphasizeenough that this need to be done and the file needs to be saved asmrtg, overwriting the distribution copy.</P><P>Now, you have successfully installed mrtg and perl.&nbsp; Now itis time to walk through the mrtg.cfg.&nbsp; Before we begin youneed to know a few things, take an opportunity to gather thefollowing information: The IP address and port number, ifapplicable, of the device you want to monitor.&nbsp; If you want tomonitor something other than bytes in and out, know the SNMPOID ofwhat you want to monitor.&nbsp; Finally you need to know theread-only SNMP community string for your device.&nbsp; If you don'tknow it, try public, that is the default.</P><P>For the rest of this document we will be using device10.10.10.1( a CISCO Catalyst 5000) with Community string public.&nbsp; We areinterested in monitoring traffic on ports 3, 5, 10, and 24, and theCPU Load. Let's begin.</P><P>The first thing we do in setting up mrtg is by making a defaultconfig file. Get to a cmd prompt and change to the c:\mrtg-2.8.12directory. Type the following command:</P><P>perl cfgmaker public@10.10.10.1 &gt; mrtg.cfg</P><P>This creates an initial MRTG config file for you. If you have aCisco router you can try the --vendor switch which will produce amore robust web page (seen soon).</P><P>If you get an error message like the following, your communityname is probably wrong. This is a good time to get familiar withthis error screen. Later, when we try more advanced monitoring wemay run into similar screens but for different reasons.</P><P><IMG src="window2.jpg" width="649" height="167"></P><P>Now, lets take a look at the mrtg.cfg file that was created.</P><P class="c4">In Perl a # is a comment, synonymous with REM in DOSand Blue text is my comments.</P><P class="c4">Add the following to the top of the mrtg.cfgfile:</P><P>WorkDir: D:\InetPub\wwwroot\MRTG</P><P class="c4">This is where the web pages are created,usually a webroot.</P><P><BR>######################################################################<BR># Description: LCP SUWGB<BR># Contact: Administrator<BR># System Name: LC-Bridge<BR># Location: Here<BR>#.....................................................................<BR><BR>Target[10.10.10.1.1]: 1:public@10.10.10.1 <SPAN class="c5">TargetDevice's IP Address:Interface Number:Community:IPAddress</SPAN><BR>MaxBytes[10.10.10.1.1]: 1250000 <SPAN class="c5">This is theinterface speed (Default is 10megabits; for 100Mbit devices use12500000</SPAN> <SPAN class="c5">and so on...)</SPAN><BR>Title[10.10.10.1.1]: LC-Bridge (sample.device): ether0<BR>PageTop[10.10.10.1.1]: &lt;H1&gt;Traffic Analysis for ether0 <SPANclass="c5">This section determines how the web page headers willlook</SPAN><BR>&lt;/H1&gt;<BR>&lt;TABLE&gt;<BR>&lt;TR&gt;&lt;TD&gt;System:&lt;/TD&gt;&lt;TD&gt;LC-BridgeinAndover&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Maintainer:&lt;/TD&gt;&lt;TD&gt;Administrator&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Interface:&lt;/TD&gt;&lt;TD&gt;ether0(1)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;IP:&lt;/TD&gt;&lt;TD&gt;sample.device(10.10.10.1)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Max Speed:&lt;/TD&gt;<BR>&lt;TD&gt;1250.0 kBytes/s(ethernetCsmacd)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR><BR>#---------------------------------------------------------------<BR><BR>Target[10.10.10.1.2]: 2:public@10.10.10.1<BR>MaxBytes[10.10.10.1.2]: 1250000<BR>Title[10.10.10.1.2]: LC-Bridge (): ulink0<BR>PageTop[10.10.10.1.2]: &lt;H1&gt;Traffic Analysis for ulink0<BR>&lt;/H1&gt;<BR>&lt;TABLE&gt;<BR>&lt;TR&gt;&lt;TD&gt;System:&lt;/TD&gt;&lt;TD&gt;LC-BridgeinAndover&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Maintainer:&lt;/TD&gt;&lt;TD&gt;Administrator&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Interface:&lt;/TD&gt;&lt;TD&gt;ulink0(2)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;IP:&lt;/TD&gt;&lt;TD&gt;()&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Max Speed:&lt;/TD&gt;<BR>&lt;TD&gt;1250.0 kBytes/s(ethernetCsmacd)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR><BR>#---------------------------------------------------------------<BR></P><P>And that is a very basic mrtg config file. You can run this andsee your results by typing:</P><P>c:\perl\bin\perl c:\mrtg-2.8.12\mrtg c:\mrtg-2.8.12\mrtg.cfg</P><P>It is normal to get errors, these are what they should looklike.</P><P><IMG src="window3.jpg" width="645" height="212"></P><P>Notice the numbers of the directory name are different in thescreen shot. This screen shot was from an older version ofMRTG.</P><P>If you take a look at those web pages they are not realexciting, <EM>yet</EM>. You need to have the mrtg files run everyfive minutes to produce the desired results. This is wherefiveminute.zip comes in to play.</P><P>You need to start the Scheduler Service so it can run the batchfiles as a service in the background. From Control Panel/Serviceshighlight "Schedule" and configure it to run automatic and have itlog on with an admin account.</P><P><IMG src="service.jpg"></P><P>Fiveminute.zip adds around 289 entries into your at schedule. ItSchedules three programs (A.bat, B.bat, and C.bat) to run atincrementing fifteen minutes; so a script runs every five minutes.You should have all three programs run the mrtg config file. Thisis all set up by default in fiveminute.zip but you can change it ifnecessary. The reason I have three scripts instead of one is incase you want to add non-mrtg scripts. I found this works best formy environment.</P><P>So from c:\mrtg-2.8.12 run 3at.bat</P><P>Now, every five minutes A.bat B.bat or C.bat will run. These areexamples of the three batch files (they are all the same).</P><P>start c:\mrtg-2.8.12\mrtgkick.bat</P><P>And mrtgkick.bat looks like:</P><P>c:\perl\bin\perl c:\mrtg-2.8.12\mrtg c:\mrtg-2.8.12\mrtg.cfg</P><P>Congratulations! You are now monitoring traffic on a device ofyour choice. Now lets look at a config file to monitor what wewanted to on our mythical Cisco Cat 5000 -- utilization on ports 3,5, 10, and 24, and the CPU Load, which will show us nonstandardmrtg configurations as well as more options..</P><P>WorkDir: D:\InetPub\wwwroot\MRTG<BR><BR>######################################################################<BR># Description: LCP SUWGB<BR># Contact: Administrator<BR># System Name: LC-Bridge<BR># Location: Here<BR>#.....................................................................<BR><BR>Target[10.10.10.1.1]: 3:public@10.10.10.1<BR>MaxBytes[10.10.10.1.1]: 1250000<BR>Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0<BR>PageTop[10.10.10.1.1]: &lt;H1&gt;Traffic Analysis for ether0<BR>&lt;/H1&gt;<BR>&lt;TABLE&gt;<BR>&lt;TR&gt;&lt;TD&gt;System:&lt;/TD&gt;&lt;TD&gt;LC-BridgeinAndover&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Maintainer:&lt;/TD&gt;&lt;TD&gt;Administrator&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Interface:&lt;/TD&gt;&lt;TD&gt;ether0(3)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;IP:&lt;/TD&gt;&lt;TD&gt;sample-device(10.10.10.1)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Max Speed:&lt;/TD&gt;<BR>&lt;TD&gt;1250.0 kBytes/s(ethernetCsmacd)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR><BR>#---------------------------------------------------------------<BR><BR>Target[10.10.10.1.2]: 5:public@10.10.10.1<BR>MaxBytes[10.10.10.1.2]: 1250000<BR>Title[10.10.10.1.2]: LC-Bridge (): ulink0<BR>PageTop[10.10.10.1.2]: &lt;H1&gt;Traffic Analysis for ulink0<BR>&lt;/H1&gt;<BR>&lt;TABLE&gt;<BR>&lt;TR&gt;&lt;TD&gt;System:&lt;/TD&gt;&lt;TD&gt;LC-BridgeinAndover&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Maintainer:&lt;/TD&gt;&lt;TD&gt;Administrator&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Interface:&lt;/TD&gt;&lt;TD&gt;ulink0(5)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;IP:&lt;/TD&gt;&lt;TD&gt;()&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Max Speed:&lt;/TD&gt;<BR>&lt;TD&gt;1250.0 kBytes/s(ethernetCsmacd)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR><BR>#---------------------------------------------------------------<BR><BR>Target[10.10.10.1.1]: 10:public@10.10.10.1<BR>MaxBytes[10.10.10.1.1]: 1250000<BR>Title[10.10.10.1.1]: LC-Bridge (sample-device): ether0<BR>PageTop[10.10.10.1.1]: &lt;H1&gt;Traffic Analysis for ether0<BR>&lt;/H1&gt;<BR>&lt;TABLE&gt;<BR>&lt;TR&gt;&lt;TD&gt;System:&lt;/TD&gt;&lt;TD&gt;LC-BridgeinAndover&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Maintainer:&lt;/TD&gt;&lt;TD&gt;Administrator&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Interface:&lt;/TD&gt;&lt;TD&gt;ether0(10)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;IP:&lt;/TD&gt;&lt;TD&gt;sample-device(10.10.10.1)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Max Speed:&lt;/TD&gt;<BR>&lt;TD&gt;1250.0 kBytes/s(ethernetCsmacd)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR><BR>#---------------------------------------------------------------<BR><BR>Target[10.10.10.1.2]: 24:public@10.10.10.1<BR>MaxBytes[10.10.10.1.2]: 1250000<BR>Title[10.10.10.1.2]: LC-Bridge (): ulink0<BR>PageTop[10.10.10.1.2]: &lt;H1&gt;Traffic Analysis for ulink0<BR>&lt;/H1&gt;<BR>&lt;TABLE&gt;<BR>&lt;TR&gt;&lt;TD&gt;System:&lt;/TD&gt;&lt;TD&gt;LC-BridgeinAndover&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Maintainer:&lt;/TD&gt;&lt;TD&gt;Administrator&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Interface:&lt;/TD&gt;&lt;TD&gt;ulink0(24)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;IP:&lt;/TD&gt;&lt;TD&gt;()&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;Max Speed:&lt;/TD&gt;<BR>&lt;TD&gt;1250.0 kBytes/s(ethernetCsmacd)&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR><BR>#---------------------------------------------------------------<BR><BR># Router CPU load %<BR>Target[cpu.1]:1.3.6.1.4.1.9.2.1.58.0&amp;1.3.6.1.4.1.9.2.1.58.0:public@10.10.10.1<BR>RouterUptime[cpu.1]: public@10.10.10.1<BR>MaxBytes[cpu.1]: 100<BR>Title[cpu.1]: CPU LOAD<BR>PageTop[cpu.1]: &lt;H1&gt;CPU Load %&lt;/H1&gt;<BR>#Title[cpu.1]: CPU Utilization<BR>Unscaled[cpu.1]: ymwd<BR>ShortLegend[cpu.1]: %<BR>XSize[cpu.1]: 380<BR>YSize[cpu.1]: 100<BR>YLegend[cpu.1]: CPU Utilization<BR>Legend1[cpu.1]: CPU Utilization in % (Load)<BR>Legend2[cpu.1]: CPU Utilization in % (Load)<BR>Legend3[cpu.1]:<BR>Legend4[cpu.1]:<BR>LegendI[cpu.1]:<BR>LegendO[cpu.1]: &amp;nbsp;Usage<BR>Options[cpu.1]: gauge<BR></P><P>This is a nice example of how to monitor any SNMP device if youknow what OID you want to use. Once again, For an explanation ofthe more advance features of mrtg, please see Tobias'sdocumentation.</P><P>Good Luck!</P><HR><P>David S. Divins <A href="mailto:ddivins@moon.jic.com">ddivins @moon.jic.com</A></P><P>Steve Pierce <A href="mailto:mrtg@HDL.com">MRTG @HDL.com</A></P><P>&nbsp;</P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -