📄 config.pod
字号:
By default, mrtg puts all the files that it generates for eachtarget (the GIFs, the HTML page, the log file, etc.) in I<WorkDir>.If the I<Directory> option is specified, the files are instead putinto a directory under I<WorkDir>. (For example the I<Directory>option below would cause all the files for a target ezwfto be put into directory /usr/tardis/pub/www/stats/mrtg/ezwf/ .)The directory must already exist; mrtg will not create it.Example: WorkDir: /usr/tardis/pub/www/stats/mrtg Directory[ezwf]: ezwf=head2 XSize and YSizeBy default mrtgs graphs are 100 by 400 pixels wide (plussome more for the labels. In the example we get almostsquare graphs ...Note: XSize must be between 20 and 600; YSize must be larger than 20Example: XSize[ezwf]: 300 YSize[ezwf]: 300=head2 XZoom and YZoomIf you want your graphs to have larger pixels, you can"Zoom" them.Example: XZoom[ezwf]: 2.0 YZoom[ezwf]: 2.0=head2 XScale and YScaleIf you want your graphs to be actually scaled use I<XScale>and I<YScale>. (Beware while this works, the results look ugly (to be frank) so if someone wants to fix this: patches are welcome.Example: XScale[ezwf]: 1.5 YScale[ezwf]: 1.5=head2 YTics and YTicsFactorIf you want to show more than 4 lines per graph, use YTics.If you want to scale the value used for the YLegend of thesetics, use YTicsFactor.The default value for YTics is 4 and the default value forYTicsFactor is 1.0 .Example: Suppose you get values ranging from 0 to 700. You want to plot 7 lines and want to show 0, 1, 2, 3, 4, 5, 6, 7 instead of 0, 100, 200, 300, 400, 500, 600, 700. You should write then: YTics[ezwf]: 7 YTicsFactor[ezwf]: 0.01=head2 StepChange the default step from 5 * 60 seconds to something else (I have not tested this well ...)Example: Step[ezwf]: 60=head2 OptionsThe I<Options> Keyword allows you to set some boolean switches:=over 4=item growright The graph grows to the left by default.This option flips the direction of growthcausing the current time to be at the right edgeof the graph and the history values to the left of it.=item bits All the monitored variable values are multiplied by 8(i.e. shown in bits instead of bytes) ... looks much more impressive :-)It also affects the 'factory default' labeling and unitsfor the given target.=item perminuteAll the monitored variable values are multiplied by 60(i.e. shown in units per minute instead of units per second) in caseof small values more accurate graphs are displayed.It also affects the 'factory default' labeling and unitsfor the given target.=item perhourAll the monitored variable values are multiplied by 3600(i.e. shown in units per hour instead of units per second) in caseof small values more accurate graphs are displayed.It also affects the 'factory default' labeling and unitsfor the given target.=item noinfoSuppress the information about uptime anddevice name in the generated webpage.=item nopercentDon't print usage percentages=item transparentmake the background of the generated gifs transparent ...=item integerPrint summary lines below graph as integers without comma=item dorelpercentThe relative percentage of IN-traffic to OUT-traffic is calculatedand displayed in the graph as an additional line.Note: Only a fixed scale is available (from 0 to 100%). Thereforefor IN-traffic greater than OUT-traffic also 100% is displayed.If you suspect that your IN-traffic is not always less than or equalto your OUT-traffic you are urged to not use this options.Note: If you use this option in combination with the I<Colours>options, a fifth colour-name colour-value pair is required there.=item gaugeTreat the values gathered from target as absoluteand not as ever incrementing counters.This would be useful to monitor things like disk space,processor load, temperature, and the like ...In the absence of 'gauge' and 'absolute' options,MRTG treats variable as a counter and calculatesthe difference between the current and the previous valueand divides that by the elapsed time betweenthe last two readings to get the value to be plotted.=item absoluteThis is for data sources which reset their value when they are read. Thismeans that rateup does not havt to build the difference between this and thelast value read from the data source. The value obtained is still divided bythe elapsed time between the last two readings, which makes it differentfrom the 'gauge' option. Useful for external data gatherers.=item unknaszeroLog unknown data as zero instead of the default behaviour of repeating thelast value seen. Be careful with this, often a flat line in the graph ismuch more obvious than a line at 0.=backExample: Options[ezwf]: growright, bits=head2 kiloUse this option to change the multiplier value for buildingprefixes. Defaultvalue is 1000. This tag is for the specialcase that 1kB = 1024B, 1MB = 1024kB and so far.Example: kilo[ezwf]: 1024=head2 kMGChange the default multiplier prefixes (,k,M,G,T,P). In the tagI<ShortLegend> define only the basic units.Format: Comma seperated list of prefixed. Two consecutive commasor a comma at start or end of the line gives no prefix on this item.Note: If you do not want prefixes, then leave this line blank.Example: velocity in nm/s (nanometers per second) displayed in nm/h. ShortLegend[ezwf]: m/min kMG[ezwf]: n,u,m,,k,M,G,T,P options[ezwf]: perhour=head2 ColoursThe I<Colours> tag allows you to override the default colourscheme. Note: All 4 of the required colours must bespecified here. The colour name ('Colourx' below) is thelegend name displayed, while the RGB value is the realcolour used for the display, both on the graph and in thehtml doc.Format is: Colour1#RRGGBB,Colour2#RRGGBB,Colour3#RRGGBB,Colour4#RRGGBBImportant:If you use the I<dorelpercent> options tag a fifth colour namecolour value pair is required:Colour1#RRGGBB,Colour2#RRGGBB,Colour3#RRGGBB,Colour4#RRGGBB,Colour5#RRGGBB=over 4=item Colour1First variable (normally Input) on default graph=item Colour2Second variable (normally Output) on default graph=item Colour3Max first variable (input)=item Colour4Max second variable (output)=item RRGGBB2 digit hex values for Red, Green and Blue=back Example: Colours[ezwf]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff=head2 BackgroundWith the I<Background> tag you can configure the backgroundcolour of the generated HTML pageExample: Background[ezwf]: #a0a0a0a=head2 YLegend, ShortLegend, Legend[1234]The following keywords allow you to override the textdisplayed for the various legends of the graph and in theHTML document=over 4=item YLegendThe Y-axis label of the graph. Note that a text which is too longto fit in the graph will be silently ignored.=item ShortLegendThe units string (default 'b/s') used for Max, Average and Current=item Legend[1234IO]The strings for the colour legend=backExample: YLegend[ezwf]: Bits per Second ShortLegend[ezwf]: b/s Legend1[ezwf]: Incoming Traffic in Bits per Second Legend2[ezwf]: Outgoing Traffic in Bits per Second Legend3[ezwf]: Maximal 5 Minute Incoming Traffic Legend4[ezwf]: Maximal 5 Minute Outgoing Traffic LegendI[ezwf]: In: LegendO[ezwf]: Out:Note, if I<LegendI> or I<LegendO> are set to an empty string with LegendO[ezwf]:The corresponding line below the graph will not be printed at all.=head2 TimezoneIf you live in an international world, you might want to generate the graphs in different timezones. This is set in the TZ variable. Under certain operating systems like Solaris, this will provoke the localtime call to give the time in the selected timezone ...Example: Timezone[ezwf]: JapanThe Timezone is the standard Solaris timezone, ie Japan, Hongkong,GMT, GMT+1 etc etc.=head2 WeekformatBy default, mrtg (actually rateup) uses the strftime(3) '%W' optionto format week numbers in the monthly graphs. The exact semanticsof this format option vary between systems. If you find that theweek numbers are wrong, and your system's strftime(3) routinesupports it, you can try another format option. The POSIX '%V'option seems to correspond to a widely used week numberingconvention. The week format character should be specified as asingle letter; either W, V, or U.Example: Weekformat[ezwf]: V=head1 Threshold CheckingThrough its threshold checking functionality mrtg is able to detectthreshold problems for the various targets and can call externalscripts to handle those problems (send email or a page to an administrator). Threshold checking is configured through the following parameters:=head2 ThreshDir (GLOBAL)If you want to be able to detect when a parameter is OK again (back withinthreshold), you must define this directory. Temporary files will be storedhere between runnings to indicate which parameters had threshold problems onthe previous running.=head2 ThreshMinI (PER TARGET)This is the minimum acceptable value for the Input (first) parameter. Ifthe parameter falls below this value, the program specified in ThreshProgIwill be run.=head2 ThreshMaxI (PER TARGET)This is the maximum acceptable value for the Input (first) parameter. Ifthe parameter falls above this value, the program specified in ThreshProgIwill be run.=head2 ThreshDesc (PER TARGET)Its value will be assigned to the environment variable THRESH_DESC beforeany of the programs mentioned below are called. The programms can use the valueof this variable to produce more userfriendly output.=head2 ThreshProgI (PER TARGET)This defines a program to be run if ThreshMinI or ThreshMaxI is broken. (Itcurrently passes 3 arguments: the $router variable, the threshold valuebroken, and the current parameter value. This can be changed as required.)=head2 ThreshProgOKI (PER TARGET)This defines a program to be run if the parameter is currently OK (based onThreshMinI and ThreshMaxI), but wasn't OK on the previous running -- basedon the files found in ThreshDir.=head2 ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKO They work the same as their *I counterparts, except on the Output (second)parameter.=head1 Two very special Target namesTo save yourself some typing you can define a targetcalled '^'. The text of every Keyword you define for thistarget will be PREPENDED to the corresponding Keyword ofall the targets defined below this line. The same goes fora Target called '$' but its text will be APPENDED.Note that a space is inserted between the prepended textand the Keyword value, as well as between the Keyword valueand the appended text. This works well for text-valued Keywords,but is not very useful for other Keywords. See the "default"target description below.The example will make mrtg use a common header and acommon contact person in all the pages generated fromtargets defined later in this file.Example: PageTop[^]: <H1>NoWhere Unis Traffic Stats</H1><HR> PageTop[$]: Contact Peter Norton if you have any questions<HR>To remove the prepend/append value, specify an empty value, e.g.: PageTop[^]: PageTop[$]:=head1 And one more very special Target nameThe target name '_' specifies a default value for thatKeyword. In the absence of explicit Keyword value, the prependedand the appended keyword value, the default value will be used.Example: YSize[_]: 150 Options[_]: growright,bits,nopercent WithPeak[_]: ymw Suppress[_]: y MaxBytes[_]: 1250000To remove the default value and return to the 'factory default',specify an empty value, e.g.: YLegend[_]:There can be several instances of setting the default/prepend/appendvalues in the configuration file. The later setting replaces theprevious one for the rest of the configuration file.The default/prepend/append values used for a givenkeyword/target pair are the ones that were in effectat the point in the configuration file where the targetwas mentioned for the first time.Example: MaxBytes[_]: 1250000 Target[myrouter.somplace.edu.2]: 2:public@myrouter.somplace.edu MaxBytes[_]: 8000 Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF 2The default I<MaxBytes> for the target myrouter.somplace.edu.2in the above example will be 1250000, which was in effectwhere the target name myrouter.somplace.edu.2 first appearedin the config file.=head1 NoSpaceCharWith PREPEND and APPEND there is normally a space inserted between the localvalue and the PRE- or APPEND value. Sometimes this is not desirable. You canuse the I<NoSpaceChar> config option to define a character which can bementioned at the end of a $ or ^ definition in order to supress the space.Example: NoSpaceChar: ~ Target[^]: 1.3.6.1.4.1.482.50.2.4.20.0&1.3.6.1.4.1.482.50.2.4.21.0:get@~ Target[a]: a.tolna.net Target[b]: b.tolna.net Target[c]: c.tolna.net Target[d]: d.tolna.net=head1 Some example mrtg.cfg files=head2 Minimal mrtg.cfg WorkDir: /usr/tardis/pub/www/stats/mrtg Target[r1]: 2:public@myrouter.somplace.edu MaxBytes[r1]: 8000 Title[r1]: Traffic Analysis ISDN PageTop[r1]: <H1>Stats for our ISDN Line</H1>=head2 Cfg for several Routers. WorkDir: /usr/tardis/pub/www/stats/mrtg Title[^]: Traffic Analysis for PageTop[^]: <H1>Stats for PageTop[$]: Contact The Chief if you notice anybody<HR> MaxBytes[_]: 8000 Options[_]: growright Title[isdn]: our ISDN Line PageTop[isdn]: our ISDN Line</H1> Target[isdn]: 2:public@router.somplace.edu Title[backb]: our Campus Backbone PageTop[backb]: our Campus Backbone</H1> Target[backb]: 1:public@router.somplace.edu MaxBytes[backb]: 1250000 # the following line removes the default prepend value # defined above Title[^]: Title[isdn2]: Traffic for the Backup ISDN Line PageTop[isdn2]: our ISDN Line</H1> Target[isdn2]: 3:public@router.somplace.edu=begin html<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR> <TD WIDTH=63><A ALT="MRTG" HREF="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"><IMG BORDER=0 SRC="mrtg-l.gif"></A></TD> <TD WIDTH=25><A ALT="" HREF="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"><IMG BORDER=0 SRC="mrtg-m.gif"></A></TD> <TD WIDTH=388><A ALT="" HREF="http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html"><IMG BORDER=0 SRC="mrtg-r.gif"></A></TD> </TR></TABLE><SPACER TYPE=VERTICAL SIZE=4><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR VALIGN=top> <TD WIDTH=388 ALIGN=LEFT><FONT FACE="Arial,Helvetica" SIZE=2> <A HREF="http://ee-staff.ethz.ch/~oetiker/">Tobias Oetiker</A> <A HREF="mailto:oetiker@ee.ethz.ch"><oetiker@ee.ethz.ch></A> and <A HREF="http://www.bungi.com">Dave Rand</A> <A HREF="mailto:dlr@bungi.com"><dlr@bungi.com></A></FONT> </TD></TR></TABLE>=end html
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -