📄 config.html
字号:
<HTML><HEAD><TITLE>Multi Router Traffic Grapher -- Configuration File Format</TITLE><LINK REV="made" HREF="mailto:karrer@zinal.ee.ethz.ch"></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#990200" VLINK="#006342" ><!-- INDEX BEGIN --><UL> <LI><A HREF="#Multi_Router_Traffic_Grapher_">Multi Router Traffic Grapher - Configuration File Format</A> <LI><A HREF="#Global_Configuration">Global Configuration </A> <LI><A HREF="#Optional_Global_Parameters">Optional Global Parameters</A> <UL> <LI><A HREF="#Refresh">Refresh</A> <LI><A HREF="#Interval">Interval</A> <LI><A HREF="#WriteExpires">WriteExpires</A> <LI><A HREF="#IconDir">IconDir</A> <LI><A HREF="#LoadMIBs">LoadMIBs</A> <LI><A HREF="#Language">Language</A> <LI><A HREF="#UseRRDTool">UseRRDTool</A> <LI><A HREF="#RunAsDaemon">RunAsDaemon</A> </UL> <LI><A HREF="#Configuration_for_each_Target_yo">Configuration for each Target you want to monitor</A> <UL> <LI><A HREF="#Target">Target</A> <LI><A HREF="#RouterUptime">RouterUptime</A> <LI><A HREF="#MaxBytes">MaxBytes</A> <LI><A HREF="#MaxBytes1">MaxBytes1</A> <LI><A HREF="#MaxBytes2">MaxBytes2</A> <LI><A HREF="#Title">Title</A> <LI><A HREF="#PageTop">PageTop</A> </UL> <LI><A HREF="#Optional_Target_Configuration_Ta">Optional Target Configuration Tags</A> <UL> <LI><A HREF="#AddHead">AddHead</A> <LI><A HREF="#AbsMax">AbsMax </A> <LI><A HREF="#Unscaled">Unscaled</A> <LI><A HREF="#WithPeak">WithPeak</A> <LI><A HREF="#Suppress">Suppress</A> <LI><A HREF="#Directory">Directory</A> <LI><A HREF="#XSize_and_YSize">XSize and YSize</A> <LI><A HREF="#XZoom_and_YZoom">XZoom and YZoom</A> <LI><A HREF="#XScale_and_YScale">XScale and YScale</A> <LI><A HREF="#YTics_and_YTicsFactor">YTics and YTicsFactor</A> <LI><A HREF="#Step">Step</A> <LI><A HREF="#Options">Options</A> <LI><A HREF="#kilo">kilo</A> <LI><A HREF="#kMG">kMG</A> <LI><A HREF="#Colours">Colours</A> <LI><A HREF="#Background">Background</A> <LI><A HREF="#YLegend_ShortLegend_Legend_123">YLegend, ShortLegend, Legend[1234]</A> <LI><A HREF="#Timezone">Timezone</A> <LI><A HREF="#Weekformat">Weekformat</A> </UL> <LI><A HREF="#Threshold_Checking">Threshold Checking</A> <UL> <LI><A HREF="#ThreshDir_GLOBAL_">ThreshDir (GLOBAL)</A> <LI><A HREF="#ThreshMinI_PER_TARGET_">ThreshMinI (PER TARGET)</A> <LI><A HREF="#ThreshMaxI_PER_TARGET_">ThreshMaxI (PER TARGET)</A> <LI><A HREF="#ThreshDesc_PER_TARGET_">ThreshDesc (PER TARGET)</A> <LI><A HREF="#ThreshProgI_PER_TARGET_">ThreshProgI (PER TARGET)</A> <LI><A HREF="#ThreshProgOKI_PER_TARGET_">ThreshProgOKI (PER TARGET)</A> <LI><A HREF="#ThreshMinO_ThreshMaxO_ThreshPr">ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO </A> </UL> <LI><A HREF="#Two_very_special_Target_names">Two very special Target names</A> <LI><A HREF="#And_one_more_very_special_Target">And one more very special Target name</A> <LI><A HREF="#NoSpaceChar">NoSpaceChar</A> <LI><A HREF="#Some_example_mrtg_cfg_files">Some example mrtg.cfg files</A> <UL> <LI><A HREF="#Minimal_mrtg_cfg">Minimal mrtg.cfg</A> <LI><A HREF="#Cfg_for_several_Routers_">Cfg for several Routers.</A> </UL></UL><!-- INDEX END --><HR><img src="mrtg-ti.gif"><P><HR><H1><A NAME="Multi_Router_Traffic_Grapher_">Multi Router Traffic Grapher -- Configuration File Format</A></H1><P>This file is for use with MRTG 2.8.12<P>Note:<UL><LI><P>Keywords must start at the beginning of a line.<LI><P>Lines which follow a keyword line which do start with a blank are appendedto the keyword line<LI><P>Empty Lines are ignored<LI><P>Lines starting with a # sign are comments.</UL><P><HR><H1><A NAME="Global_Configuration">Global Configuration</A></H1><P>Workdir specifies where the logfiles and the webpages should be created.<P>Example:<P><PRE> WorkDir: /usr/tardis/pub/www/stats/mrtg</PRE><P><HR><H1><A NAME="Optional_Global_Parameters">Optional Global Parameters</A></H1><P><HR><H2><A NAME="Refresh">Refresh</A></H2><P>How many seconds apart should the browser (Netscape) be instructed toreload the page? If this is not defined, the default is 300 seconds (5minutes).<P>Example:<P><PRE> Refresh: 600</PRE><P><HR><H2><A NAME="Interval">Interval</A></H2><P>How often do you call mrtg? The default is 5 minutes. If you call it lessoften, you should specify it here. This does two things:<UL><LI><P>the generated HTML page does contain the right information about thecalling interval ...<LI><P>a META header in the generated HTML page will instruct caches about thetime to live of this page .....</UL><P>In this example we tell mrtg that we will be calling it every 10 minutes.If you are calling mrtg every 5 minutes, you can leave this line commentedout.<P>Example:<P><PRE> Interval: 10</PRE><P><HR><H2><A NAME="WriteExpires">WriteExpires</A></H2><P>With this switch mrtg will generate .meta files for CERN and Apache serverswhich contain Expiration tags for the html and gif files. The *.meta fileswill be created in the same directory as the other files, so you will haveto set ``MetaDir .'' and ``MetaFiles on'' in your apache.conf or .htaccessfile for this to work<P>NOTE: If you are running Apache-1.2 or later, you can use the mod_expire toachieve the same effect ... see the file htaccess.txt<P>Example:<P><PRE> WriteExpires: Yes</PRE><P><HR><H2><A NAME="IconDir">IconDir</A></H2><P>If you want to keep the mrtg icons in some place other than the workingdirectory, use the <EM>IconDir</EM> variable to give its url.<P>Example:<P><PRE> IconDir: /mrtgicons/</PRE><P><HR><H2><A NAME="LoadMIBs">LoadMIBs</A></H2><P>Load the MIB <CODE>file(s)</CODE> specified and make its OIDs available assymbolic names. For better efficiancy, a cache of MIBs is maintained in theWorkDir.<P>Example:<P><PRE> LoadMIBs: /dept/net/mibs/netapp.mib,/usr/local/lib/ft100m.mib</PRE><P><HR><H2><A NAME="Language">Language</A></H2><P>Switch output format to the selected Language (At the moment, the values:danish, french, english, dutch, brazilian, russian, spanish, greek anditalian are supported)<P>Example:<P><PRE> Language: danish</PRE><P><HR><H2><A NAME="UseRRDTool">UseRRDTool</A></H2><P>Setting 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 <AHREF="mailto:Rainer.Bawidamann@informatik.uni-ulm.de.">Rainer.Bawidamann@informatik.uni-ulm.de.</A>Please check his website for more information: <AHREF="http://www.uni-ulm.de/~rbawidam/mrtg-rrd/">http://www.uni-ulm.de/~rbawidam/mrtg-rrd/</A><P>Example:<P><PRE> UseRRDTool: Yes</PRE><P><HR><H2><A NAME="RunAsDaemon">RunAsDaemon</A></H2><P>The RunAsDaemon keyword enables daemon mode operation. The purpose ofdaemon mode is that MRTG is launched once and not at regular basis by cronas in native mode. This behavior saves computing resourses as loading andparsing of configuration files only hapens once.<P>Using daemon mode MRTG itself is responible for timing the measurementintervals. Therfore its important to set the Interval keyword to anapropiate value.<P>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.<P>Also note that in daemon mode restart of the process is required in orderto activate changes in the config file.<P>Under UNIX, the Daemon switch causes mrtg to fork into background afterchecking its config file.<P>Example<P><PRE> RunAsDaemon:Yes Interval:5</PRE><P>Makes MRTG run as a daemon beginning data collection every 5 minutes<P><HR><H1><A NAME="Configuration_for_each_Target_yo">Configuration for each Target you want to monitor</A></H1><P>The configuration keywords <EM>Target</EM> must be followed by a unique name. This will also be the name used for thewebpages, logfiles and gifs created for that target.<P>Note that the <EM>Target</EM> sections can be auto-generated with the <STRONG>cfgmaker</STRONG> tool. Check <EM>readme.html</EM> for instructions.<P><HR><H2><A NAME="Target">Target</A></H2><P>With the <EM>Target</EM> keyword you tell mrtg what it should monitor. The <EM>Target</EM> keyword takes arguments in a wide range of formats:<UL><LI><P>The most basic format is ``port:community@router'' This will generate atraffic graph for the interface 'port' of the host 'router' (dns name or IPaddress) and it will use the community 'community' (snmp password) for thesnmp query.<P>Example:<P><PRE> Target[ezwf]: 2:public@wellfleet-fddi.ethz.ch</PRE><LI><P>Sometimes you are sitting on the wrong side of the link, and you would liketo have mrtg report Incoming traffic as outgoing and vice versa. This canbe achieved by adding the '-' sign in front of the ``Target'' description.It flips the incoming and outgoing traffic rates.<P>Example:<P><PRE> Target[ezci]: -1:public@ezci-ether.ethz.ch</PRE><LI><P>You can also explicitly define the OID to query by using the followingsyntax 'OID_1&OID_2:community@router' The following example willretrieve error counts for input and output on interface 1. MRTG needs tograph two variables, so you need to specify two OID's such as temperatureand humidity or error input and error output.<P>Example:<P><PRE> 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</PRE><LI><P>MRTG knows a number of symbolical SNMP variable names. See the filemibhelp.txt for a list of known names. One example are the ifInErrors andifOutErrors. This means you can specify the above as:<P>Example:<P><PRE> Target[ezwf]: ifInErrors.1&ifOutErrors.1:public@myrouter</PRE><LI><P>Sometimes SNMP interface index can change, like when new interfaces areadded or removed. This can cause all Target entries in your config file tobecome wrong by offset, causing MRTG to graphs wrong instances etc. MRTGsupports IP address instead of ifindex in target definition. Then MRTG willquery snmp device and try to map IP address to current ifindex, You can useIP address in every type of target definition, by adding IP address of thenumbered interface after OID and separation char '/'<P>Make sure that given IP address is used on your same target router, yoursame target router, especially when graphing two different OIDs and/orinterface split by '&' delimiter.<P>Example:<P><PRE> 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</PRE><LI><P>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 Addressfrom the *.cfg file to its current index, and then uses that index for therest of the session.<P>You can use the Physical Address in every type of target definition, byadding the Physical Address after the OID and separation char '!'(analogous to the IP address option). The Physical address is specified aseither '-' delimited octets, such as ``0a-0-f1-5-23-18'' (omit the doublequotes) or a string with exactly two chars per octet such as``0a00f1052318''. Note that there are 6 octets for for ethernet hardaddresses but other types of network connections may differ.<P>There is a utility 'cfgmaker_phys' that can be used to convert everyinterface index or IP addresses to the new Physical Address format,``cfgmaker_phys old.cfg > new.cfg'' or it can be combined with'cfgmaker' as follows ``cfgmaker <AHREF="mailto:public@1.2.3.4">public@1.2.3.4</A> | cfgmaker_phys >new.cfg''. If however you only want to convert some - not all - of theinterfaces, this must be done manually.<P>Example:<P><PRE> 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</PRE><A NAME="Target-SNMP-Parameters"></A><LI><P>In all places where ``community@router'' is accepted, you can addadditional parameters for the SNMP communication using colon-separatedsuffixes. The full syntax is as follows:<P><PRE> community@router[:port[:timeout[:retries[:backoff]]]]</PRE><P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -