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