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

📄 config.pod

📁 主要用于监控网络流量并动态产生可视化结果
💻 POD
📖 第 1 页 / 共 2 页
字号:
=for html<img src="mrtg-ti.gif">=head1 Multi Router Traffic Grapher -- Configuration File FormatThis file is for use with MRTG 2.8.12Note:=over 4=item * Keywords must start at the beginning of a line.=item * Lines which follow a keyword line which do start with a blank are appended to the keyword line=item * Empty Lines are ignored=item * Lines starting with a # sign are comments.=back=head1 Global Configuration Workdir specifies where the logfiles and the webpages should be created.Example: WorkDir: /usr/tardis/pub/www/stats/mrtg=head1 Optional Global Parameters=head2 RefreshHow many seconds apart should the browser (Netscape) be  instructed to reload the page? If this is not defined, the  default is 300 seconds (5 minutes).Example: Refresh: 600=head2 IntervalHow often do you call mrtg? The default is 5 minutes. Ifyou call it less often, you should specify it here. Thisdoes two things:=over 4=item *the generated HTML page does contain the rightinformation about the calling interval ...=item *a META header in the generated HTML page will instructcaches about the time to live of this page .....=backIn this example we tell mrtg that we will be calling itevery 10 minutes. If you are calling mrtg every 5minutes, you can leave this line commented out.Example: Interval: 10=head2 WriteExpiresWith this switch mrtg will generate .meta files for CERNand Apache servers which contain Expiration tags for thehtml and gif files. The *.meta files will be created inthe same directory as the other files, so you will haveto set "MetaDir ." and "MetaFiles on"in your apache.conf or .htaccess file for this to workNOTE: If you are running Apache-1.2 or later, you can use the mod_expireto achieve the same effect ... see the file htaccess.txtExample: WriteExpires: Yes=head2 IconDirIf you want to keep the mrtg icons in some place other than the working directory, use the I<IconDir> variable to give its url.Example: IconDir: /mrtgicons/=head2 LoadMIBsLoad the MIB file(s) specified and make its OIDs available assymbolic names. For better efficiancy, a cache of MIBs is maintainedin the WorkDir.Example: LoadMIBs: /dept/net/mibs/netapp.mib,/usr/local/lib/ft100m.mib=head2 LanguageSwitch output format to the selected Language (At the moment, the values:danish, french, english, dutch, brazilian, russian, spanish, greek and italian are supported)Example: Language: danish=head2 UseRRDToolSetting UseRRDTool to Yes in your mrtg.cfg file enables rrdtool mode. Inrrdtool mode, mrtg relies on rrdtool to do its logging. Graphs and htmlpages will be generated on the fly by the 14all.cgi which can be found inthe contrib section together with a short readme ... This feature has beencontributed by Rainer.Bawidamann@informatik.uni-ulm.de. Please check hiswebsite for more information: http://www.uni-ulm.de/~rbawidam/mrtg-rrd/Example: UseRRDTool: Yes=head2 RunAsDaemonThe RunAsDaemon keyword enables daemon mode operation. The purpose of daemonmode is that MRTG is launched once and not at regular basis by cron as innative mode. This behavior saves computing resourses as loading and parsingof configuration files only hapens once.Using daemon mode MRTG itself is responible for timing the measurementintervals. Therfore its important to set the Interval keyword to anapropiate value.Note that using daemon mode MRTG should no longer be started from cron byregular basis as each started process runs forever. Instead MRTG should bestarted from the command prompt or by a system startup script.Also note that in daemon mode restart of the process is required in order toactivate changes in the config file.Under UNIX, the Daemon switch causes mrtg to fork into background afterchecking its config file.Example RunAsDaemon:Yes Interval:5Makes MRTG run as a daemon beginning data collection every 5 minutes=head1 Configuration for each Target you want to monitorThe configuration keywords I<Target> must be followed by aunique name. This will also be the name used for thewebpages, logfiles and gifs created for that target.Note that the I<Target> sections can be auto-generated withthe B<cfgmaker> tool. Check F<readme.html> for instructions.=head2 TargetWith the I<Target> keyword you tell mrtg what it shouldmonitor. The I<Target> keyword takes arguments in a widerange of formats:=over 4=item * The most basic format is "port:community@router"This will generate a traffic graph for the interface 'port'of the host 'router' (dns name or IP address)and it will use the community 'community' (snmp password)for the snmp query.Example: Target[ezwf]: 2:public@wellfleet-fddi.ethz.ch=item * Sometimes you are sitting on the wrong side of thelink, and you would like to have mrtg report Incomingtraffic as outgoing and vice versa. This can be achievedby adding the '-' sign in front of the "Target"description. It flips the incoming and outgoing traffic rates.Example: Target[ezci]: -1:public@ezci-ether.ethz.ch=item * You can also explicitly define the OID to query by using thefollowing syntax 'OID_1&OID_2:community@router'The following example will retrieve error counts for input and outputon interface 1.  MRTG needs to graph two variables,so you need to specify two OID's such as temperature and humidityor error input and error output.Example: Target[ezwf]: 1.3.6.1.2.1.2.2.1.14.1&1.3.6.1.2.1.2.2.1.20.1:public@myrouter=item * MRTG knows a number of symbolical SNMP variable names.See the file mibhelp.txt for a list of known names.One example are the ifInErrors and ifOutErrors.This means you can specify the above as:Example: Target[ezwf]: ifInErrors.1&ifOutErrors.1:public@myrouter=item *Sometimes SNMP interface index can change, like when new interfaces areadded or removed. This can cause all Target entries in your config fileto become wrong by offset, causing MRTG to graphs wrong instances etc.MRTG supports IP address instead of ifindex in target definition. ThenMRTG will query snmp device and try to map IP address to current ifindex,You can use IP address in every type of target definition, by addingIP address of the numbered interface after OID and separation char '/'Make sure that given IP address is used on your same target router,your same target router, especially when graphing two different OIDsand/or interface split by '&' delimiter.Example: Target[ezwf]: /1.2.3.4:public@wellfleet-fddi.ethz.ch Target[ezci]: -/1.2.3.4:public@ezci-ether.ethz.ch Target[ezwf]: 1.3.6.1.2.1.2.2.1.14/1.2.3.4&/1.2.3.4:public@myrouter Target[ezwf]: ifInErrors/1.2.3.4&ifOutErrors/1.2.3.4:public@myrouter=item *When the SNMP interface index changes, you can key that interface by its'Physical Address', sometimes called a 'hard address', which is the SNMPvariable 'ifPhysAddress'.  Internally, MRTG matches the Physical Address fromthe *.cfg file to its current index, and then uses that index for the rest ofthe session.You can use the Physical Address in every type of target definition, by addingthe Physical Address after the OID and separation char '!' (analogous to the IPaddress option).  The Physical address is specified as either '-' delimitedoctets, such as "0a-0-f1-5-23-18" (omit the double quotes) or a string withexactly two chars per octet such as "0a00f1052318".  Note that there are 6octets for for ethernet hard addresses but other types of network connectionsmay differ.There is a utility 'cfgmaker_phys' that can be used to convert every interface indexor IP addresses to the new Physical Address format, "cfgmaker_phys old.cfg > new.cfg"or it can be combined with 'cfgmaker' as follows "cfgmaker public@1.2.3.4 |cfgmaker_phys > new.cfg".  If however you only want to convert some - not all - of theinterfaces, this must be done manually.Example: Target[ezwf]: !0a-0b-0c-0d:public@wellfleet-fddi.ethz.ch Target[ezci]: -!0-f-bb-05-71-22:public@ezci-ether.ethz.ch Target[ezwf]: 1.3.6.1.2.1.2.2.1.14!0a-00-10-23-44-51&!0a-00-10-23-44-51:public@myrouter Target[ezwf]: ifInErrors!0a-00-10-23-44-51&ifOutErrors!0a-00-10-23-44-51:public@myrouter=for html<A NAME="Target-SNMP-Parameters"></A>=item *In all places where ``community@router'' is accepted, you can addadditional parameters for the SNMP communication usingcolon-separated suffixes. The full syntax is as follows: community@router[:port[:timeout[:retries[:backoff]]]]where the meaning of each parameter is as follows:=over 4=item portthe UDP port under which to contact the SNMP agent (default: 161)=item timeoutinitial timeout for SNMP queries, in seconds (default: 2.0)=item retriesnumber of times a timed-out request will be retried (default: 5)=item backofffactor by which the timeout is multiplied on every retry (default: 1.0).=backA value that equals the default value can be omitted.  Trailing colonscan be omitted, too.Example:  Target[ezci]: 1:public@ezci-ether.ethz.ch:9161::4This would refer to the input/output octet counters for the interfacewith I<ifIndex 1> on I<ezci-ether.ethz.ch>, as knownby the SNMP agent listening on UDP port 9161.  The standard initialtimeout (2.0 seconds) is used, but the number of retries is set tofour.  The backoff value is the default.=item * if you want to monitor something which does not providedata via snmp you can use some external program to dothe data gathering.The external command must return 4 lines of output:=over 4=item Line 1current state of the first variable, normally 'incoming bytes count'=item Line 2current state of the second variable, normally 'outgoing bytes count'   =item Line 3string (in any human readable format), telling the uptime of the target.=item Line 4string, telling the name of the target. =backDepending on the type of data your script returns youmight want to use the 'gauge' or 'absolute' argumentsfor the I<Options> keyword.Example: Target[ezwf]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`Note the use of the backticks (`), not apostrophes (')around the command.=item * You can also use several statements in a mathematical expression.  This could be used to aggregate both B channelsin an ISDN connection or multiple T1s that are aggregatedinto a single channel for greater bandwidth.Note the whitespace arround the target definitions.Example: Target[ezwf]: 2:public@wellfleetA + 1:public@wellfleetA              * 4:public@ciscoF=back=head2 RouterUptimeIn cases where you calculate the used bandwidth fromseveral interfaces you normaly don't get the router uptimeand router name displayed on the web page.If these interfaces are on the same router and the uptime andname should be displayed nevertheless you have to specifyits community and address again with the I<RouterUptime> keyword.Example: Target[kacisco.comp.edu]: 1:public@194.64.66.250 + 2:public@194.64.66.250 RouterUptime[kacisco.comp.edu]: public@194.64.66.250=head2 MaxBytesThe maximum value either of the two variables monitoredare allowed to reach. For monitoring router trafficthis is normally specified in bytes per second thisinterface port can carry.If a number higher than I<MaxBytes> is returned, it is ignored.Also read the section on I<AbsMax> for further info.The I<MaxBytes> value is also used in calculating the Y rangefor unscaled graphs (see the section on I<Unscaled>).Since most links are rated in bits per second, you need to dividetheir maximum bandwidth (in bits) by eight (8) in order to getbytes per second.  This is very important to make yourunscaled graphs display realistic information.T1 = 193000, 56K = 7000, Ethernet = 1250000. The I<MaxBytes>value will be used by mrtg to decide whether it got avalid response from the router.If you need two different MaxBytes values for the two monitoredvariables, you can use MaxBytes1 and MaxBytes2 instead of MaxBytes.Example: MaxBytes[ezwf]: 1250000=head2 MaxBytes1Same as MaxBytes, for variable 1.=head2 MaxBytes2Same as MaxBytes, for variable 2.=head2 TitleTitle for the HTML page which gets generated for the graph.Example: Title[ezwf]: Traffic Analysis for Our Nice Company=head2 PageTopThings to add to the top of the generated HTML page.  Notethat you can have several lines of text as long as thefirst column is empty.Note that the continuation lines will all end up on the sameline in the html page. If you want linebreaks in the generated html use the '\n' sequence.Example: PageTop[ezwf]: <H1>Traffic Analysis for ETZ C95.1</H1>   Our Campus Backbone runs over an FDDI line\n   with a maximum transfer rate of 12.5 megabytes per   Second.=head1 Optional Target Configuration Tags=head2 AddHeadUse this tag like the I<PageTop> header, but its contentswill be added between </TITLE> and </HEAD>.Example: AddHead[ezwf]: <link rev="made" href="mailto:mrtg@blabla.edu">=head2 AbsMax If you are monitoring a link which can handle more trafficthan the I<MaxBytes> value. Eg, a line which uses compressionor some frame relay link, you can use the I<AbsMax> keywordto give the absolute maximum value ever to be reached.We need to know this in order to sort out unrealistic valuesreturned by the routers. If you do not set I<AbsMax>, rateupwill ignore values higher than I<MaxBytes>.Example: AbsMax[ezwf]: 2500000=head2 UnscaledBy default each graph is scaled vertically to make theactual data visible even when it is much lower thanI<MaxBytes>.  With the I<Unscaled> variable you can suppressthis.  It's argument is a string, containing one letterfor each graph you don't want to be scaled: d=day w=weekm=month y=year.  In the example scaling for theyearly and the monthly graph are suppressed.Example: Unscaled[ezwf]: ym=head2 WithPeakBy default the graphs only contain the averagevalues of the monitored variables - normally thetransfer rates for incoming and outgoing traffic.The following option instructs mrtg to display the peak5 minute values in the [w]eekly, [m]onthly and[y]early graph. In the example we define the monthlyand the yearly graph to contain peak as well as averagevalues.Examples: WithPeak[ezwf]: ym=head2 SuppressBy default mrtg produces 4 graphs. With this optionyou can suppress the generation of selected graphs.The option value syntax is analogous to the above two options.In this example we suppress the yearly graphas it is quite empty in the beginning.Example: Suppress[ezwf]: y=head2 Directory

⌨️ 快捷键说明

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