| Date: | Sep 25 2000 19:29:21 EDT |
| From: | "Kevison Dennys Carrilho Bentes" <[EMAIL PROTECTED]> |
| Subject: | Re: [redewan] MRTG |
|
Oi Andr�,
Aqui segue um trecho da documenta��o.
Grato.
Kevison Dennys Carrilho Bentes
Gerente de Rede Air System Network Bras�lia - DF Brasil Fone: 55 61 313-8002 Fax: 55 61 313-8008 [EMAIL PROTECTED]
Multi Router Traffic Grapher -- Configuration File FormatThis file is for use with MRTG 2.8.12 Note:
Global ConfigurationWorkdir specifies where the logfiles and the webpages should be created. Example: WorkDir: /usr/tardis/pub/www/stats/mrtg
Optional Global Parameters
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
IntervalHow often do you call mrtg? The default is 5 minutes. If you call it less often, you should specify it here. This does two things:
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 commented out. Example: Interval: 10
WriteExpiresWith this switch mrtg will generate .meta files for CERN and Apache servers which contain Expiration tags for the html and gif files. The *.meta files will be created in the same directory as the other files, so you will have to set ``MetaDir .'' and ``MetaFiles on'' in your apache.conf or .htaccess file for this to work NOTE: If you are running Apache-1.2 or later, you can use the mod_expire to achieve the same effect ... see the file htaccess.txt Example: WriteExpires: Yes
IconDirIf you want to keep the mrtg icons in some place other than the working directory, use the IconDir variable to give its url. Example: IconDir: /mrtgicons/
LoadMIBsLoad the MIB Example: LoadMIBs: /dept/net/mibs/netapp.mib,/usr/local/lib/ft100m.mib
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
UseRRDToolSetting UseRRDTool to Yes in your mrtg.cfg file enables rrdtool mode. In rrdtool mode, mrtg relies on rrdtool to do its logging. Graphs and html pages will be generated on the fly by the 14all.cgi which can be found in the contrib section together with a short readme ... This feature has been contributed by [EMAIL PROTECTED] Please check his website for more information: http://www.uni-ulm.de/~rbawidam/mrtg-rrd/ Example: UseRRDTool: Yes
RunAsDaemonThe RunAsDaemon keyword enables daemon mode operation. The purpose of daemon mode is that MRTG is launched once and not at regular basis by cron as in native mode. This behavior saves computing resourses as loading and parsing of configuration files only hapens once. Using daemon mode MRTG itself is responible for timing the measurement intervals. Therfore its important to set the Interval keyword to an apropiate value. Note that using daemon mode MRTG should no longer be started from cron by regular basis as each started process runs forever. Instead MRTG should be started from the command prompt or by a system startup script. Also note that in daemon mode restart of the process is required in order to activate changes in the config file. Under UNIX, the Daemon switch causes mrtg to fork into background after checking its config file. Example RunAsDaemon:Yes Interval:5 Makes MRTG run as a daemon beginning data collection every 5 minutes
Configuration for each Target you want to monitorThe configuration keywords Target must be followed by a unique name. This will also be the name used for the webpages, logfiles and gifs created for that target. Note that the Target sections can be auto-generated with the cfgmaker tool. Check readme.html for instructions.
TargetWith the Target keyword you tell mrtg what it should monitor. The Target keyword takes arguments in a wide range of formats:
RouterUptimeIn cases where you calculate the used bandwidth from several interfaces you normaly don't get the router uptime and router name displayed on the web page. If these interfaces are on the same router and the uptime and name should be displayed nevertheless you have to specify its community and address again with the RouterUptime keyword. Example: Target[kacisco.comp.edu]: 1:[EMAIL PROTECTED] + 2:[EMAIL PROTECTED] RouterUptime[kacisco.comp.edu]: [EMAIL PROTECTED]
MaxBytesThe maximum value either of the two variables monitored are allowed to reach. For monitoring router traffic this is normally specified in bytes per second this interface port can carry. If a number higher than MaxBytes is returned, it is ignored. Also read the section on AbsMax for further info. The MaxBytes value is also used in calculating the Y range for unscaled graphs (see the section on Unscaled). Since most links are rated in bits per second, you need to divide their maximum bandwidth (in bits) by eight (8) in order to get bytes per second. This is very important to make your unscaled graphs display realistic information. T1 = 193000, 56K = 7000, Ethernet = 1250000. The MaxBytes value will be used by mrtg to decide whether it got a valid response from the router. If you need two different MaxBytes values for the two monitored variables, you can use MaxBytes1 and MaxBytes2 instead of MaxBytes. Example: MaxBytes[ezwf]: 1250000
MaxBytes1Same as MaxBytes, for variable 1.
MaxBytes2Same as MaxBytes, for variable 2.
TitleTitle for the HTML page which gets generated for the graph. Example: Title[ezwf]: Traffic Analysis for Our Nice Company
PageTopThings to add to the top of the generated HTML page. Note that you can have several lines of text as long as the first column is empty. Note that the continuation lines will all end up on the same line 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.
Optional Target Configuration Tags
AddHeadUse this tag like the PageTop header, but its contents will be added between </TITLE> and </HEAD>. Example: AddHead[ezwf]: <link rev="made" href="mailto:[EMAIL PROTECTED]";>
AbsMaxIf you are monitoring a link which can handle more traffic than the MaxBytes value. Eg, a line which uses compression or some frame relay link, you can use the AbsMax keyword to give the absolute maximum value ever to be reached. We need to know this in order to sort out unrealistic values returned by the routers. If you do not set AbsMax, rateup will ignore values higher than MaxBytes. Example: AbsMax[ezwf]: 2500000
UnscaledBy default each graph is scaled vertically to make the actual data visible even when it is much lower than MaxBytes. With the Unscaled variable you can suppress this. It's argument is a string, containing one letter for each graph you don't want to be scaled: d=day w=week m=month y=year. In the example scaling for the yearly and the monthly graph are suppressed. Example: Unscaled[ezwf]: ym
WithPeakBy default the graphs only contain the average values of the monitored variables - normally the transfer rates for incoming and outgoing traffic. The following option instructs mrtg to display the peak 5 minute values in the [w]eekly, [m]onthly and [y]early graph. In the example we define the monthly and the yearly graph to contain peak as well as average values. Examples: WithPeak[ezwf]: ym
SuppressBy default mrtg produces 4 graphs. With this option you 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 graph as it is quite empty in the beginning. Example: Suppress[ezwf]: y
DirectoryBy default, mrtg puts all the files that it generates for each target (the GIFs, the HTML page, the log file, etc.) in WorkDir. If the Directory option is specified, the files are instead put into a directory under WorkDir. (For example the Directory option below would cause all the files for a target ezwf to 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
XSize and YSizeBy default mrtgs graphs are 100 by 400 pixels wide (plus some more for the labels. In the example we get almost square graphs ... Note: XSize must be between 20 and 600; YSize must be larger than 20 Example: XSize[ezwf]: 300 YSize[ezwf]: 300
XZoom and YZoomIf you want your graphs to have larger pixels, you can ``Zoom'' them. Example: XZoom[ezwf]: 2.0 YZoom[ezwf]: 2.0
XScale and YScaleIf you want your graphs to be actually scaled use XScale and 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
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 these tics, use YTicsFactor. The default value for YTics is 4 and the default value for YTicsFactor 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
StepChange the default step from 5 * 60 seconds to something else (I have not tested this well ...) Example: Step[ezwf]: 60
OptionsThe Options Keyword allows you to set some boolean switches:
Example: Options[ezwf]: growright, bits
kiloUse this option to change the multiplier value for building prefixes. Defaultvalue is 1000. This tag is for the special case that 1kB = 1024B, 1MB = 1024kB and so far. Example: kilo[ezwf]: 1024
kMGChange the default multiplier prefixes (,k,M,G,T,P). In the tag ShortLegend define only the basic units. Format: Comma seperated list of prefixed. Two consecutive commas or 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
ColoursThe Colours tag allows you to override the default colour scheme. Note: All 4 of the required colours must be specified here. The colour name ('Colourx' below) is the legend name displayed, while the RGB value is the real colour used for the display, both on the graph and in the html doc. Format is: Colour1#RRGGBB,Colour2#RRGGBB,Colour3#RRGGBB,Colour4#RRGGBB Important: If you use the dorelpercent options tag a fifth colour name colour value pair is required: Colour1#RRGGBB,Colour2#RRGGBB,Colour3#RRGGBB,Colour4#RRGGBB,Colour5#RRGGBB
Example: Colours[ezwf]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff
BackgroundWith the Background tag you can configure the background colour of the generated HTML page Example: Background[ezwf]: #a0a0a0a
YLegend, ShortLegend, Legend[1234]The following keywords allow you to override the text displayed for the various legends of the graph and in the HTML document
Example: 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 LegendI or LegendO are set to an empty string with LegendO[ezwf]: The corresponding line below the graph will not be printed at all.
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]: Japan The Timezone is the standard Solaris timezone, ie Japan, Hongkong, GMT, GMT+1 etc etc.
WeekformatBy default, mrtg (actually rateup) uses the Example: Weekformat[ezwf]: V
Threshold CheckingThrough its threshold checking functionality mrtg is able to detect threshold problems for the various targets and can call external scripts to handle those problems (send email or a page to an administrator). Threshold checking is configured through the following parameters:
ThreshDir (GLOBAL)If you want to be able to detect when a parameter is OK again (back within threshold), you must define this directory. Temporary files will be stored here between runnings to indicate which parameters had threshold problems on the previous running.
ThreshMinI (PER TARGET)This is the minimum acceptable value for the Input (first) parameter. If the parameter falls below this value, the program specified in ThreshProgI will be run.
ThreshMaxI (PER TARGET)This is the maximum acceptable value for the Input (first) parameter. If the parameter falls above this value, the program specified in ThreshProgI will be run.
ThreshDesc (PER TARGET)Its value will be assigned to the environment variable THRESH_DESC before any of the programs mentioned below are called. The programms can use the value of this variable to produce more userfriendly output.
ThreshProgI (PER TARGET)This defines a program to be run if ThreshMinI or ThreshMaxI is broken. (It
currently passes 3 arguments: the
ThreshProgOKI (PER TARGET)This defines a program to be run if the parameter is currently OK (based on ThreshMinI and ThreshMaxI), but wasn't OK on the previous running -- based on the files found in ThreshDir.
ThreshMinO, ThreshMaxO, ThreshProgO, and ThreshProgOKOThey work the same as their
Two very special Target namesTo save yourself some typing you can define a target called '^'. The text of every Keyword you define for this target will be PREPENDED to the corresponding Keyword of all the targets defined below this line. The same goes for a Target called '$' but its text will be APPENDED. Note that a space is inserted between the prepended text and the Keyword value, as well as between the Keyword value and 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 a common contact person in all the pages generated from targets 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[$]:
And one more very special Target nameThe target name '_' specifies a default value for that Keyword. In the absence of explicit Keyword value, the prepended and the appended keyword value, the default value will be used. Example: YSize[_]: 150 Options[_]: growright,bits,nopercent WithPeak[_]: ymw Suppress[_]: y MaxBytes[_]: 1250000 To 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/append values in the configuration file. The later setting replaces the previous one for the rest of the configuration file. The default/prepend/append values used for a given keyword/target pair are the ones that were in effect at the point in the configuration file where the target was mentioned for the first time. Example: MaxBytes[_]: 1250000 Target[myrouter.somplace.edu.2]: 2:[EMAIL PROTECTED] MaxBytes[_]: 8000 Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF 2 The default MaxBytes for the target myrouter.somplace.edu.2 in the above example will be 1250000, which was in effect where the target name myrouter.somplace.edu.2 first appeared in the config file.
NoSpaceCharWith PREPEND and APPEND there is normally a space inserted between the local value and the PRE- or APPEND value. Sometimes this is not desirable. You can use the NoSpaceChar config option to define a character which can be mentioned 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
Some example mrtg.cfg files
Minimal mrtg.cfgWorkDir: /usr/tardis/pub/www/stats/mrtg Target[r1]: 2:[EMAIL PROTECTED] MaxBytes[r1]: 8000 Title[r1]: Traffic Analysis ISDN PageTop[r1]: <H1>Stats for our ISDN Line</H1>
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:[EMAIL PROTECTED] Title[backb]: our Campus Backbone PageTop[backb]: our Campus Backbone</H1> Target[backb]: 1:[EMAIL PROTECTED] 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:[EMAIL PROTECTED]
|
|||||



