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