| [2094] | 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 | |
|---|
| [2226] | 17 | m = Map("luci_statistics") |
|---|
| [2094] | 18 | |
|---|
| 19 | -- collectd_network config section |
|---|
| [2226] | 20 | s = m:section( NamedSection, "collectd_network", "luci_statistics" ) |
|---|
| [2094] | 21 | |
|---|
| 22 | -- collectd_network.enable |
|---|
| [2226] | 23 | enable = s:option( Flag, "enable" ) |
|---|
| [2094] | 24 | enable.default = 0 |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | -- collectd_network_listen config section (Listen) |
|---|
| [2226] | 28 | listen = m:section( TypedSection, "collectd_network_listen" ) |
|---|
| [2094] | 29 | listen.addremove = true |
|---|
| 30 | listen.anonymous = true |
|---|
| 31 | |
|---|
| 32 | -- collectd_network_listen.host |
|---|
| [2226] | 33 | listen_host = listen:option( Value, "host" ) |
|---|
| [2094] | 34 | listen_host.default = "0.0.0.0" |
|---|
| 35 | |
|---|
| 36 | -- collectd_network_listen.port |
|---|
| [2226] | 37 | listen_port = listen:option( Value, "port" ) |
|---|
| [2094] | 38 | listen_port.default = 25826 |
|---|
| 39 | listen_port.isinteger = true |
|---|
| 40 | listen_port.optional = true |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | -- collectd_network_server config section (Server) |
|---|
| [2226] | 44 | server = m:section( TypedSection, "collectd_network_server" ) |
|---|
| [2094] | 45 | server.addremove = true |
|---|
| 46 | server.anonymous = true |
|---|
| 47 | |
|---|
| 48 | -- collectd_network_server.host |
|---|
| [2226] | 49 | server_host = server:option( Value, "host" ) |
|---|
| [2094] | 50 | server_host.default = "0.0.0.0" |
|---|
| 51 | |
|---|
| 52 | -- collectd_network_server.port |
|---|
| [2226] | 53 | server_port = server:option( Value, "port" ) |
|---|
| [2094] | 54 | server_port.default = 25826 |
|---|
| 55 | server_port.isinteger = true |
|---|
| 56 | server_port.optional = true |
|---|
| 57 | |
|---|
| 58 | -- collectd_network.timetolive (TimeToLive) |
|---|
| [2226] | 59 | ttl = s:option( Value, "TimeToLive" ) |
|---|
| [2094] | 60 | ttl.default = 128 |
|---|
| 61 | ttl.isinteger = true |
|---|
| 62 | ttl.optional = true |
|---|
| 63 | ttl:depends( "enable", 1 ) |
|---|
| 64 | |
|---|
| 65 | -- collectd_network.forward (Forward) |
|---|
| [2226] | 66 | forward = s:option( Flag, "Forward" ) |
|---|
| [2094] | 67 | forward.default = 0 |
|---|
| 68 | forward.optional = true |
|---|
| 69 | forward:depends( "enable", 1 ) |
|---|
| 70 | |
|---|
| [2226] | 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 ) |
|---|
| [2094] | 77 | |
|---|
| 78 | |
|---|
| 79 | return m |
|---|