Update my email addresses in the license headers
[project/luci.git] / applications / luci-app-statistics / luasrc / model / cbi / luci_statistics / network.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 m = Map("luci_statistics",
5 translate("Network Plugin Configuration"),
6 translate(
7 "The network plugin provides network based communication between " ..
8 "different collectd instances. Collectd can operate both in client " ..
9 "and server mode. In client mode locally collected date is " ..
10 "transferred to a collectd server instance, in server mode the " ..
11 "local instance receives data from other hosts."
12 ))
13
14 -- collectd_network config section
15 s = m:section( NamedSection, "collectd_network", "luci_statistics" )
16
17 -- collectd_network.enable
18 enable = s:option( Flag, "enable", translate("Enable this plugin") )
19 enable.default = 0
20
21
22 -- collectd_network_listen config section (Listen)
23 listen = m:section( TypedSection, "collectd_network_listen",
24 translate("Listener interfaces"),
25 translate(
26 "This section defines on which interfaces collectd will wait " ..
27 "for incoming connections."
28 ))
29 listen.addremove = true
30 listen.anonymous = true
31
32 -- collectd_network_listen.host
33 listen_host = listen:option( Value, "host", translate("Listen host") )
34 listen_host.default = "0.0.0.0"
35
36 -- collectd_network_listen.port
37 listen_port = listen:option( Value, "port", translate("Listen port") )
38 listen_port.default = 25826
39 listen_port.isinteger = true
40 listen_port.optional = true
41
42
43 -- collectd_network_server config section (Server)
44 server = m:section( TypedSection, "collectd_network_server",
45 translate("server interfaces"),
46 translate(
47 "This section defines to which servers the locally collected " ..
48 "data is sent to."
49 ))
50 server.addremove = true
51 server.anonymous = true
52
53 -- collectd_network_server.host
54 server_host = server:option( Value, "host", translate("Server host") )
55 server_host.default = "0.0.0.0"
56
57 -- collectd_network_server.port
58 server_port = server:option( Value, "port", translate("Server port") )
59 server_port.default = 25826
60 server_port.isinteger = true
61 server_port.optional = true
62
63 -- collectd_network.timetolive (TimeToLive)
64 ttl = s:option( Value, "TimeToLive", translate("TTL for network packets") )
65 ttl.default = 128
66 ttl.isinteger = true
67 ttl.optional = true
68 ttl:depends( "enable", 1 )
69
70 -- collectd_network.forward (Forward)
71 forward = s:option( Flag, "Forward", translate("Forwarding between listen and server addresses") )
72 forward.default = 0
73 forward.optional = true
74 forward:depends( "enable", 1 )
75
76 -- collectd_network.cacheflush (CacheFlush)
77 cacheflush = s:option( Value, "CacheFlush",
78 translate("Cache flush interval"), translate("Seconds") )
79 cacheflush.default = 86400
80 cacheflush.isinteger = true
81 cacheflush.optional = true
82 cacheflush:depends( "enable", 1 )
83
84
85 return m