* luci/statistics: complete cbi model translation
[project/luci.git] / applications / luci-statistics / luasrc / model / cbi / luci_statistics / collectd.lua
1 --[[
2
3 Luci configuration model for statistics - general collectd 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 require("luci.sys")
17
18
19 luci.i18n.load("statistics.en")
20
21 --[[
22 m = Map("luci_statistics", "Collector Daemon",
23 Collectd ist ein kleiner und flexibler Dienst zum Sammeln und Abfragen von Daten
24 aus verschieden Quellen. Zur weiteren Verarbeitung werden die Daten in RRD Datenbanken
25 gespeichert oder per Multicast Relaying über das Netzwerk versendet.)
26 ]]--
27 m = Map("luci_statistics")
28
29 -- general config section
30 s = m:section( NamedSection, "collectd", "luci_statistics" )
31
32 -- general.hostname (Hostname)
33 hostname = s:option( Value, "Hostname" )
34 hostname.default = luci.sys.hostname()
35 hostname.optional = true
36
37 -- general.basedir (BaseDir)
38 basedir = s:option( Value, "BaseDir" )
39 basedir.default = "/var/run/collectd"
40
41 -- general.include (Include)
42 include = s:option( Value, "Include" )
43 include.default = "/etc/collectd/conf.d/*.conf"
44
45 -- general.plugindir (PluginDir)
46 plugindir = s:option( Value, "PluginDir" )
47 plugindir.default = "/usr/lib/collectd/"
48
49 -- general.pidfile (PIDFile)
50 pidfile = s:option( Value, "PIDFile" )
51 pidfile.default = "/var/run/collectd.pid"
52
53 -- general.typesdb (TypesDB)
54 typesdb = s:option( Value, "TypesDB" )
55 typesdb.default = "/etc/collectd/types.db"
56
57 -- general.interval (Interval)
58 interval = s:option( Value, "Interval" )
59 interval.default = 60
60 interval.isnumber = true
61
62 -- general.readthreads (ReadThreads)
63 readthreads = s:option( Value, "ReadThreads" )
64 readthreads.default = 5
65 readthreads.isnumber = true
66
67 -- general.fqdnlookup (FQDNLookup)
68 fqdnlookup = s:option( Flag, "FQDNLookup" )
69 fqdnlookup.enabled = "true"
70 fqdnlookup.disabled = "false"
71 fqdnlookup.default = "false"
72 fqdnlookup.optional = true
73 fqdnlookup:depends( "Hostname", "" )
74
75
76 return m