luci-0.11: merge r9571 - r9622
[project/luci.git] / applications / luci-statistics / luasrc / model / cbi / luci_statistics / unixsock.lua
1 --[[
2
3 Luci configuration model for statistics - collectd unixsock 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 translate("Unixsock Plugin Configuration"),
18 translate(
19 "The unixsock plugin creates a unix socket which can be used " ..
20 "to read collected data from a running collectd instance."
21 ))
22
23 -- collectd_unixsock config section
24 s = m:section( NamedSection, "collectd_unixsock", "luci_statistics" )
25
26 -- collectd_unixsock.enable
27 enable = s:option( Flag, "enable", translate("Enable this plugin") )
28 enable.default = 0
29
30 -- collectd_unixsock.socketfile (SocketFile)
31 socketfile = s:option( Value, "SocketFile" )
32 socketfile.default = "/var/run/collect-query.socket"
33 socketfile:depends( "enable", 1 )
34
35 -- collectd_unixsock.socketgroup (SocketGroup)
36 socketgroup = s:option( Value, "SocketGroup" )
37 socketgroup.default = "nobody"
38 socketgroup.rmempty = true
39 socketgroup.optional = true
40 socketgroup:depends( "enable", 1 )
41
42 -- collectd_unixsock.socketperms (SocketPerms)
43 socketperms = s:option( Value, "SocketPerms" )
44 socketperms.default = "0770"
45 socketperms.rmempty = true
46 socketperms.optional = true
47 socketperms:depends( "enable", 1 )
48
49 return m