📄 config.txt
字号:
GGBB Colour1 First variable (normally Input) on default graph Colour2 Second variable (normally Output) on default graph Colour3 Max first variable (input) Colour4 Max second variable (output) RRGGBB 2 digit hex values for Red, Green and Blue Example: Colours[ezwf]: GREEN#00eb0c,BLUE#1000ff,DARK GREEN#006600,VIOLET#ff00ff _________________________________________________________________ Background With 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 YLegend The Y-axis label of the graph. Note that a text which is too long to fit in the graph will be silently ignored. ShortLegend The units string (default 'b/s') used for Max, Average and Current Legend[1234IO] The strings for the colour legend 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. _________________________________________________________________ Timezone If 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. _________________________________________________________________ Weekformat By default, mrtg (actually rateup) uses the strftime(3) '%W' option to format week numbers in the monthly graphs. The exact semantics of this format option vary between systems. If you find that the week numbers are wrong, and your system's strftime(3) routine supports it, you can try another format option. The POSIX '%V' option seems to correspond to a widely used week numbering convention. The week format character should be specified as a single letter; either W, V, or U. Example: Weekformat[ezwf]: V _________________________________________________________________ Threshold Checking Through 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 $router variable, the threshold value broken, and the current parameter value. This can be changed as required.) _________________________________________________________________ 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 ThreshProgOKO They work the same as their *I counterparts, except on the Output (second) parameter. _________________________________________________________________ Two very special Target names To 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 name The 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:public@myrouter.somplace.edu MaxBytes[_]: 8000 Title[myrouter.somplace.edu.2]: Traffic Analysis for myrouter.somplace.edu IF2 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. _________________________________________________________________ NoSpaceChar With 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.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> _________________________________________________________________ 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 [58][LINK] [59][LINK] [60][LINK] [61]Tobias Oetiker [62]<oetiker@ee.ethz.ch> and [63]Dave Rand [64]<dlr@bungi.com>References 1. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Multi_Router_Traffic_Grapher_ 2. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Global_Configuration 3. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Optional_Global_Parameters 4. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Refresh 5. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Interval 6. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#WriteExpires 7. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#IconDir 8. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#LoadMIBs 9. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Language 10. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#UseRRDTool 11. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#RunAsDaemon 12. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Configuration_for_each_Target_yo 13. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Target 14. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#RouterUptime 15. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#MaxBytes 16. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#MaxBytes1 17. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#MaxBytes2 18. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Title 19. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#PageTop 20. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Optional_Target_Configuration_Ta 21. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#AddHead 22. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#AbsMax 23. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Unscaled 24. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#WithPeak 25. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Suppress 26. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Directory 27. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#XSize_and_YSize 28. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#XZoom_and_YZoom 29. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#XScale_and_YScale 30. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#YTics_and_YTicsFactor 31. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Step 32. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Options 33. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#kilo 34. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#kMG 35. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Colours 36. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Background 37. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#YLegend_ShortLegend_Legend_123 38. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Timezone 39. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Weekformat 40. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Threshold_Checking 41. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshDir_GLOBAL_ 42. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshMinI_PER_TARGET_ 43. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshMaxI_PER_TARGET_ 44. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshDesc_PER_TARGET_ 45. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshProgI_PER_TARGET_ 46. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshProgOKI_PER_TARGET_ 47. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#ThreshMinO_ThreshMaxO_ThreshPr 48. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Two_very_special_Target_names 49. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#And_one_more_very_special_Target 50. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#NoSpaceChar 51. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Some_example_mrtg_cfg_files 52. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Minimal_mrtg_cfg 53. file://localhost/home/oetiker/data/projects/AABM-mrtg/doc/config.html#Cfg_for_several_Routers_ 54. mailto:Rainer.Bawidamann@informatik.uni-ulm.de. 55. http://www.uni-ulm.de/~rbawidam/mrtg-rrd/ 56. mailto:public@1.2.3.4 57. mailto:mrtg@blabla.edu" 58. http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html 59. http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html 60. http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html 61. http://ee-staff.ethz.ch/~oetiker/ 62. mailto:oetiker@ee.ethz.ch 63. http://www.bungi.com/ 64. mailto:dlr@bungi.com
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -