statistics: Add support for entropy stats
[project/luci.git] / applications / luci-app-statistics / luasrc / model / cbi / luci_statistics / collectd.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 require("luci.sys")
5
6
7 m = Map("luci_statistics",
8         translate("Collectd Settings"),
9         translate(
10                 "Collectd is a small daemon for collecting data from " ..
11                 "various sources through different plugins. On this page " ..
12                 "you can change general settings for the collectd daemon."
13         ))
14
15 -- general config section
16 s = m:section( NamedSection, "collectd", "luci_statistics" )
17
18 -- general.hostname (Hostname)
19 hostname = s:option( Value, "Hostname", translate("Hostname") )
20 hostname.default  = luci.sys.hostname()
21 hostname.optional = true
22
23 -- general.basedir (BaseDir)
24 basedir = s:option( Value, "BaseDir", translate("Base Directory") )
25 basedir.default = "/var/run/collectd"
26
27 -- general.include (Include)
28 include = s:option( Value, "Include", translate("Directory for sub-configurations") )
29 include.default = "/etc/collectd/conf.d/*.conf"
30
31 -- general.plugindir (PluginDir)
32 plugindir = s:option( Value, "PluginDir", translate("Directory for collectd plugins") )
33 plugindir.default = "/usr/lib/collectd/"
34
35 -- general.pidfile (PIDFile)
36 pidfile = s:option( Value, "PIDFile", translate("Used PID file") )
37 pidfile.default = "/var/run/collectd.pid"
38
39 -- general.typesdb (TypesDB)
40 typesdb = s:option( Value, "TypesDB", translate("Datasets definition file") )
41 typesdb.default = "/etc/collectd/types.db"
42
43 -- general.interval (Interval)
44 interval = s:option( Value, "Interval", translate("Data collection interval"), translate("Seconds") )
45 interval.default  = 60
46 interval.isnumber = true
47
48 -- general.readthreads (ReadThreads)
49 readthreads = s:option( Value, "ReadThreads", translate("Number of threads for data collection") )
50 readthreads.default  = 5
51 readthreads.isnumber = true
52
53 -- general.fqdnlookup (FQDNLookup)
54 fqdnlookup = s:option( Flag, "FQDNLookup", translate("Try to lookup fully qualified hostname") )
55 fqdnlookup.enabled  = "true"
56 fqdnlookup.disabled = "false"
57 fqdnlookup.default  = "false"
58 fqdnlookup.optional = true
59 fqdnlookup:depends( "Hostname", "" )
60
61
62 return m