* ffluci/statistics: add cbi model for rrdtool, fix stat-genconfig to allow correctly...
[project/luci.git] / applications / luci-statistics / src / model / cbi / admin_statistics / rrdtool.lua
1 --[[
2
3 Luci configuration model for statistics - collectd rrdtool plugin configuration
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 m = Map("luci_statistics", "RRDTool Plugin",
17 [[Das RRDTool-Plugin schreibt die gesammelten Werte in sogenannte RRD Datenbanken, welche die
18 Grundlage für die Statistik-Diagramme bilden.<br /><br />
19 <strong>Die Einstellungen auf dieser Seite sollten nur in Ausnahmefällen geändert werden,
20 falsche Einstellungen führen zu einem sehr hohem Platzverbrauch im Temp-Verzeichnis und das
21 Gerät kann nur noch im Failsafe-Modus repariert werden!</strong>]])
22
23 -- collectd_rrdtool config section
24 s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics", "Pluginkonfiguration" )
25
26 -- collectd_rrdtool.enable
27 enable = s:option( Flag, "enable", "Plugin aktivieren" )
28 enable.default = 1
29
30 -- collectd_rrdtool.datadir (DataDir)
31 datadir = s:option( Value, "DataDir", "Speicherort für die RRD Datenbanken" )
32 datadir.default  = "/tmp"
33 datadir.rmempty  = true
34 datadir.optional = true
35 datadir:depends( "enable", 1 )
36
37 -- collectd_rrdtool.stepsize (StepSize)
38 stepsize = s:option( Value, "StepSize", "Schritt-Interval", "in Sekunden" )
39 stepsize.default   = 30
40 stepsize.isinteger = true
41 stepsize.rmempty   = true
42 stepsize.optional  = true
43 stepsize:depends( "enable", 1 )
44
45 -- collectd_rrdtool.heartbeat (HeartBeat)
46 heartbeat = s:option( Value, "HeartBeat", "Heart-Beat-Interval", "in Sekunden" )
47 heartbeat.default   = 60
48 heartbeat.isinteger = true
49 heartbeat.rmempty   = true
50 heartbeat.optional  = true
51 heartbeat:depends( "enable", 1 )
52
53 -- collectd_rrdtool.rrasingle (RRASingle)
54 rrasingle = s:option( Flag, "RRASingle", 'Jeweils nur ein RRA anlegen', "reduziert die Größe der RRDs" )
55 rrasingle.default  = true
56 rrasingle.rmempty  = true
57 rrasingle.optional = true
58 rrasingle:depends( "enable", 1 )
59
60 -- collectd_rrdtool.rratimespans (RRATimespan)
61 rratimespans = s:option( Value, "RRATimespans", "Gespeicherte Zeitspannen", "in Sekunden; mehrere mit Leerzeichen trennen" )
62 rratimespans.default  = "600 86400 604800 2678400 31622400"
63 rratimespans.rmempty  = true
64 rratimespans.optional = true
65 rratimespans:depends( "enable", 1 )
66
67 -- collectd_rrdtool.rrarows (RRARows)
68 rrarows = s:option( Value, "RRARows", "Anzahl der Datenpunkte pro Zeitspanne" )
69 rrarows.isinteger = true
70 rrarows.default   = 100
71 rrarows.rmempty   = true
72 rrarows.optional  = true
73 rrarows:depends( "enable", 1 )
74
75 -- collectd_rrdtool.xff (XFF)
76 xff = s:option( Value, "XFF", "RRD XFiles Faktor" )
77 xff.default  = 0.1
78 xff.isnumber = true
79 xff.rmempty  = true
80 xff.optional = true
81 xff:depends( "enable", 1 )
82
83 -- collectd_rrdtool.cachetimeout (CacheTimeout)
84 cachetimeout = s:option( Value, "CacheTimeout", "Daten für Zeitspanne cachen", "in Sekunden" )
85 cachetimeout.isinteger = true
86 cachetimeout.default   = 100
87 cachetimeout.rmempty   = true
88 cachetimeout.optional  = true
89 cachetimeout:depends( "enable", 1 )
90
91 -- collectd_rrdtool.cacheflush (CacheFlush)
92 cacheflush = s:option( Value, "CacheFlush", "Cache nach Zeitspanne leeren", "in Sekunden" )
93 cacheflush.isinteger = true
94 cacheflush.default   = 100
95 cacheflush.rmempty   = true
96 cacheflush.optional  = true
97 cacheflush:depends( "enable", 1 )
98
99 return m