f6302abc0cc002bd76977a00c458f4ca52486f90
[project/luci.git] / applications / luci-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
19 -- collectd_network config section
20 s = m:section( NamedSection, "collectd_network", "luci_statistics" )
21
22 -- collectd_network.enable
23 enable = s:option( Flag, "enable" )
24 enable.default = 0
25
26
27 -- collectd_network_listen config section (Listen)
28 listen = m:section( TypedSection, "collectd_network_listen" )
29 listen.addremove = true
30 listen.anonymous = true
31
32 -- collectd_network_listen.host
33 listen_host = listen:option( Value, "host" )
34 listen_host.default = "0.0.0.0"
35
36 -- collectd_network_listen.port
37 listen_port = listen:option( Value, "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 server.addremove = true
46 server.anonymous = true
47
48 -- collectd_network_server.host
49 server_host = server:option( Value, "host" )
50 server_host.default = "0.0.0.0"
51
52 -- collectd_network_server.port
53 server_port = server:option( Value, "port" )
54 server_port.default   = 25826
55 server_port.isinteger = true
56 server_port.optional  = true
57
58 -- collectd_network.timetolive (TimeToLive)
59 ttl = s:option( Value, "TimeToLive" )
60 ttl.default   = 128
61 ttl.isinteger = true
62 ttl.optional  = true
63 ttl:depends( "enable", 1 )
64
65 -- collectd_network.forward (Forward)
66 forward = s:option( Flag, "Forward" )
67 forward.default  = 0
68 forward.optional = true
69 forward:depends( "enable", 1 )
70
71 -- collectd_network.cacheflush (CacheFlush)
72 cacheflush = s:option( Value, "CacheFlush" )
73 cacheflush.default   = 86400
74 cacheflush.isinteger = true
75 cacheflush.optional  = true
76 cacheflush:depends( "enable", 1 )
77
78
79 return m