rrdtool.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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", translate("Storage directory") )
  19. datadir.default = "/tmp"
  20. datadir.rmempty = true
  21. datadir.optional = true
  22. datadir:depends( "enable", 1 )
  23. -- collectd_rrdtool.stepsize (StepSize)
  24. stepsize = s:option( Value, "StepSize",
  25. translate("RRD step interval"), translate("Seconds") )
  26. stepsize.default = 30
  27. stepsize.isinteger = true
  28. stepsize.rmempty = true
  29. stepsize.optional = true
  30. stepsize:depends( "enable", 1 )
  31. -- collectd_rrdtool.heartbeat (HeartBeat)
  32. heartbeat = s:option( Value, "HeartBeat",
  33. translate("RRD heart beat interval"), translate("Seconds") )
  34. heartbeat.default = 60
  35. heartbeat.isinteger = true
  36. heartbeat.rmempty = true
  37. heartbeat.optional = true
  38. heartbeat:depends( "enable", 1 )
  39. -- collectd_rrdtool.rrasingle (RRASingle)
  40. rrasingle = s:option( Flag, "RRASingle",
  41. translate("Only create average RRAs"), translate("reduces rrd size") )
  42. rrasingle.default = true
  43. rrasingle.rmempty = true
  44. rrasingle.optional = true
  45. rrasingle:depends( "enable", 1 )
  46. -- collectd_rrdtool.rratimespans (RRATimespan)
  47. rratimespans = s:option( Value, "RRATimespans",
  48. translate("Stored timespans"), translate("seconds; multiple separated by space") )
  49. rratimespans.default = "600 86400 604800 2678400 31622400"
  50. rratimespans.rmempty = true
  51. rratimespans.optional = true
  52. rratimespans:depends( "enable", 1 )
  53. -- collectd_rrdtool.rrarows (RRARows)
  54. rrarows = s:option( Value, "RRARows", translate("Rows per RRA") )
  55. rrarows.isinteger = true
  56. rrarows.default = 100
  57. rrarows.rmempty = true
  58. rrarows.optional = true
  59. rrarows:depends( "enable", 1 )
  60. -- collectd_rrdtool.xff (XFF)
  61. xff = s:option( Value, "XFF", translate("RRD XFiles Factor") )
  62. xff.default = 0.1
  63. xff.isnumber = true
  64. xff.rmempty = true
  65. xff.optional = true
  66. xff:depends( "enable", 1 )
  67. -- collectd_rrdtool.cachetimeout (CacheTimeout)
  68. cachetimeout = s:option( Value, "CacheTimeout",
  69. translate("Cache collected data for"), translate("Seconds") )
  70. cachetimeout.isinteger = true
  71. cachetimeout.default = 100
  72. cachetimeout.rmempty = true
  73. cachetimeout.optional = true
  74. cachetimeout:depends( "enable", 1 )
  75. -- collectd_rrdtool.cacheflush (CacheFlush)
  76. cacheflush = s:option( Value, "CacheFlush",
  77. translate("Flush cache after"), translate("Seconds") )
  78. cacheflush.isinteger = true
  79. cacheflush.default = 100
  80. cacheflush.rmempty = true
  81. cacheflush.optional = true
  82. cacheflush:depends( "enable", 1 )
  83. return m