rrdtool.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. m = Map("luci_statistics",
  4. translate("RRDTool Plugin Configuration"),
  5. translate(
  6. "The rrdtool plugin stores the collected data in rrd database " ..
  7. "files, the foundation of the diagrams.<br /><br />" ..
  8. "<strong>Warning: Setting the wrong values will result in a very " ..
  9. "high memory consumption in the temporary directory. " ..
  10. "This can render the device unusable!</strong>"
  11. ))
  12. -- collectd_rrdtool config section
  13. s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics" )
  14. -- collectd_rrdtool.enable
  15. enable = s:option( Flag, "enable", translate("Enable this plugin") )
  16. enable.default = 1
  17. -- collectd_rrdtool.datadir (DataDir)
  18. datadir = s:option( Value, "DataDir",
  19. translate("Storage directory"),
  20. translate("Note: as pages are rendered by user 'nobody', the *.rrd files, " ..
  21. "the storage directory and all its parent directories need " ..
  22. "to be world readable."
  23. ))
  24. datadir.default = "/tmp"
  25. datadir.rmempty = true
  26. datadir.optional = true
  27. datadir:depends( "enable", 1 )
  28. -- collectd_rrdtool.stepsize (StepSize)
  29. stepsize = s:option( Value, "StepSize",
  30. translate("RRD step interval"), translate("Seconds") )
  31. stepsize.default = 30
  32. stepsize.isinteger = true
  33. stepsize.rmempty = true
  34. stepsize.optional = true
  35. stepsize:depends( "enable", 1 )
  36. -- collectd_rrdtool.heartbeat (HeartBeat)
  37. heartbeat = s:option( Value, "HeartBeat",
  38. translate("RRD heart beat interval"), translate("Seconds") )
  39. heartbeat.default = 60
  40. heartbeat.isinteger = true
  41. heartbeat.rmempty = true
  42. heartbeat.optional = true
  43. heartbeat:depends( "enable", 1 )
  44. -- collectd_rrdtool.rrasingle (RRASingle)
  45. rrasingle = s:option( Flag, "RRASingle",
  46. translate("Only create average RRAs"), translate("reduces rrd size") )
  47. rrasingle.default = true
  48. rrasingle:depends( "enable", 1 )
  49. -- collectd_rrdtool.rramax (RRAMax)
  50. rramax = s:option( Flag, "RRAMax",
  51. translate("Show max values instead of averages"),
  52. translate("Max values for a period can be used instead of averages when not using 'only average RRAs'") )
  53. rramax.default = false
  54. rramax.rmempty = true
  55. rramax:depends( "RRASingle", 0 )
  56. -- collectd_rrdtool.rratimespans (RRATimespan)
  57. rratimespans = s:option( Value, "RRATimespans",
  58. translate("Stored timespans"), translate("seconds; multiple separated by space") )
  59. rratimespans.default = "600 86400 604800 2678400 31622400"
  60. rratimespans.rmempty = true
  61. rratimespans.optional = true
  62. rratimespans:depends( "enable", 1 )
  63. -- collectd_rrdtool.rrarows (RRARows)
  64. rrarows = s:option( Value, "RRARows", translate("Rows per RRA") )
  65. rrarows.isinteger = true
  66. rrarows.default = 100
  67. rrarows.rmempty = true
  68. rrarows.optional = true
  69. rrarows:depends( "enable", 1 )
  70. -- collectd_rrdtool.xff (XFF)
  71. xff = s:option( Value, "XFF", translate("RRD XFiles Factor") )
  72. xff.default = 0.1
  73. xff.isnumber = true
  74. xff.rmempty = true
  75. xff.optional = true
  76. xff:depends( "enable", 1 )
  77. -- collectd_rrdtool.cachetimeout (CacheTimeout)
  78. cachetimeout = s:option( Value, "CacheTimeout",
  79. translate("Cache collected data for"), translate("Seconds") )
  80. cachetimeout.isinteger = true
  81. cachetimeout.default = 100
  82. cachetimeout.rmempty = true
  83. cachetimeout.optional = true
  84. cachetimeout:depends( "enable", 1 )
  85. -- collectd_rrdtool.cacheflush (CacheFlush)
  86. cacheflush = s:option( Value, "CacheFlush",
  87. translate("Flush cache after"), translate("Seconds") )
  88. cacheflush.isinteger = true
  89. cacheflush.default = 100
  90. cacheflush.rmempty = true
  91. cacheflush.optional = true
  92. cacheflush:depends( "enable", 1 )
  93. return m