ba78bb4ef3efacac39a6a876d12723571e7a65fa
[project/luci.git] / applications / luci-statistics / luasrc / model / cbi / luci_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")
17
18 -- collectd_rrdtool config section
19 s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics" )
20
21 -- collectd_rrdtool.enable
22 enable = s:option( Flag, "enable" )
23 enable.default = 1
24
25 -- collectd_rrdtool.datadir (DataDir)
26 datadir = s:option( Value, "DataDir" )
27 datadir.default  = "/tmp"
28 datadir.rmempty  = true
29 datadir.optional = true
30 datadir:depends( "enable", 1 )
31
32 -- collectd_rrdtool.stepsize (StepSize)
33 stepsize = s:option( Value, "StepSize" )
34 stepsize.default   = 30
35 stepsize.isinteger = true
36 stepsize.rmempty   = true
37 stepsize.optional  = true
38 stepsize:depends( "enable", 1 )
39
40 -- collectd_rrdtool.heartbeat (HeartBeat)
41 heartbeat = s:option( Value, "HeartBeat" )
42 heartbeat.default   = 60
43 heartbeat.isinteger = true
44 heartbeat.rmempty   = true
45 heartbeat.optional  = true
46 heartbeat:depends( "enable", 1 )
47
48 -- collectd_rrdtool.rrasingle (RRASingle)
49 rrasingle = s:option( Flag, "RRASingle" )
50 rrasingle.default  = true
51 rrasingle.rmempty  = true
52 rrasingle.optional = true
53 rrasingle:depends( "enable", 1 )
54
55 -- collectd_rrdtool.rratimespans (RRATimespan)
56 rratimespans = s:option( Value, "RRATimespans" )
57 rratimespans.default  = "600 86400 604800 2678400 31622400"
58 rratimespans.rmempty  = true
59 rratimespans.optional = true
60 rratimespans:depends( "enable", 1 )
61
62 -- collectd_rrdtool.rrarows (RRARows)
63 rrarows = s:option( Value, "RRARows" )
64 rrarows.isinteger = true
65 rrarows.default   = 100
66 rrarows.rmempty   = true
67 rrarows.optional  = true
68 rrarows:depends( "enable", 1 )
69
70 -- collectd_rrdtool.xff (XFF)
71 xff = s:option( Value, "XFF" )
72 xff.default  = 0.1
73 xff.isnumber = true
74 xff.rmempty  = true
75 xff.optional = true
76 xff:depends( "enable", 1 )
77
78 -- collectd_rrdtool.cachetimeout (CacheTimeout)
79 cachetimeout = s:option( Value, "CacheTimeout" )
80 cachetimeout.isinteger = true
81 cachetimeout.default   = 100
82 cachetimeout.rmempty   = true
83 cachetimeout.optional  = true
84 cachetimeout:depends( "enable", 1 )
85
86 -- collectd_rrdtool.cacheflush (CacheFlush)
87 cacheflush = s:option( Value, "CacheFlush" )
88 cacheflush.isinteger = true
89 cacheflush.default   = 100
90 cacheflush.rmempty   = true
91 cacheflush.optional  = true
92 cacheflush:depends( "enable", 1 )
93
94 return m