luci-app-statistics: add advice about data directory permissions
[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",
23         translate("Storage directory"),
24         translate("Note: as pages are rendered by user 'nobody', the *.rrd files, " ..
25                   "the storage directory and all its parent directories need " ..
26                   "to be world readable."
27         ))
28 datadir.default  = "/tmp"
29 datadir.rmempty  = true
30 datadir.optional = true
31 datadir:depends( "enable", 1 )
32
33 -- collectd_rrdtool.stepsize (StepSize)
34 stepsize = s:option( Value, "StepSize",
35         translate("RRD step interval"), translate("Seconds") )
36 stepsize.default   = 30
37 stepsize.isinteger = true
38 stepsize.rmempty   = true
39 stepsize.optional  = true
40 stepsize:depends( "enable", 1 )
41
42 -- collectd_rrdtool.heartbeat (HeartBeat)
43 heartbeat = s:option( Value, "HeartBeat",
44         translate("RRD heart beat interval"), translate("Seconds") )
45 heartbeat.default   = 60
46 heartbeat.isinteger = true
47 heartbeat.rmempty   = true
48 heartbeat.optional  = true
49 heartbeat:depends( "enable", 1 )
50
51 -- collectd_rrdtool.rrasingle (RRASingle)
52 rrasingle = s:option( Flag, "RRASingle",
53         translate("Only create average RRAs"), translate("reduces rrd size") )
54 rrasingle.default  = true
55 rrasingle:depends( "enable", 1 )
56
57 -- collectd_rrdtool.rramax (RRAMax)
58 rramax = s:option( Flag, "RRAMax",
59         translate("Show max values instead of averages"),
60         translate("Max values for a period can be used instead of averages when not using 'only average RRAs'") )
61 rramax.default  = false
62 rramax.rmempty  = true
63 rramax:depends( "RRASingle", 0 )
64
65 -- collectd_rrdtool.rratimespans (RRATimespan)
66 rratimespans = s:option( Value, "RRATimespans",
67         translate("Stored timespans"), translate("seconds; multiple separated by space") )
68 rratimespans.default  = "600 86400 604800 2678400 31622400"
69 rratimespans.rmempty  = true
70 rratimespans.optional = true
71 rratimespans:depends( "enable", 1 )
72
73 -- collectd_rrdtool.rrarows (RRARows)
74 rrarows = s:option( Value, "RRARows", translate("Rows per RRA") )
75 rrarows.isinteger = true
76 rrarows.default   = 100
77 rrarows.rmempty   = true
78 rrarows.optional  = true
79 rrarows:depends( "enable", 1 )
80
81 -- collectd_rrdtool.xff (XFF)
82 xff = s:option( Value, "XFF", translate("RRD XFiles Factor") )
83 xff.default  = 0.1
84 xff.isnumber = true
85 xff.rmempty  = true
86 xff.optional = true
87 xff:depends( "enable", 1 )
88
89 -- collectd_rrdtool.cachetimeout (CacheTimeout)
90 cachetimeout = s:option( Value, "CacheTimeout",
91         translate("Cache collected data for"), translate("Seconds") )
92 cachetimeout.isinteger = true
93 cachetimeout.default   = 100
94 cachetimeout.rmempty   = true
95 cachetimeout.optional  = true
96 cachetimeout:depends( "enable", 1 )
97
98 -- collectd_rrdtool.cacheflush (CacheFlush)
99 cacheflush = s:option( Value, "CacheFlush",
100         translate("Flush cache after"), translate("Seconds") )
101 cacheflush.isinteger = true
102 cacheflush.default   = 100
103 cacheflush.rmempty   = true
104 cacheflush.optional  = true
105 cacheflush:depends( "enable", 1 )
106
107 return m