3 Luci configuration model for statistics - collectd netlink plugin configuration
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
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
10 http://www.apache.org/licenses/LICENSE-2.0
18 local devices = luci.sys.net.devices()
21 m = Map("luci_statistics",
22 translate("Netlink Plugin Configuration"),
24 "The netlink plugin collects extended informations like " ..
25 "qdisc-, class- and filter-statistics for selected interfaces."
28 -- collectd_netlink config section
29 s = m:section( NamedSection, "collectd_netlink", "luci_statistics" )
31 -- collectd_netlink.enable
32 enable = s:option( Flag, "enable", translate("Enable this plugin") )
35 -- collectd_netlink.interfaces (Interface)
36 interfaces = s:option( MultiValue, "Interfaces", translate("Basic monitoring") )
37 interfaces.widget = "select"
38 interfaces.optional = true
39 interfaces.size = #devices + 1
40 interfaces:depends( "enable", 1 )
42 for i, v in ipairs(devices) do
46 -- collectd_netlink.verboseinterfaces (VerboseInterface)
47 verboseinterfaces = s:option( MultiValue, "VerboseInterfaces", translate("Verbose monitoring") )
48 verboseinterfaces.widget = "select"
49 verboseinterfaces.optional = true
50 verboseinterfaces.size = #devices + 1
51 verboseinterfaces:depends( "enable", 1 )
52 verboseinterfaces:value("")
53 for i, v in ipairs(devices) do
54 verboseinterfaces:value(v)
57 -- collectd_netlink.qdiscs (QDisc)
58 qdiscs = s:option( MultiValue, "QDiscs", translate("Qdisc monitoring") )
59 qdiscs.widget = "select"
60 qdiscs.optional = true
61 qdiscs.size = #devices + 1
62 qdiscs:depends( "enable", 1 )
64 for i, v in ipairs(devices) do
68 -- collectd_netlink.classes (Class)
69 classes = s:option( MultiValue, "Classes", translate("Shaping class monitoring") )
70 classes.widget = "select"
71 classes.optional = true
72 classes.size = #devices + 1
73 classes:depends( "enable", 1 )
75 for i, v in ipairs(devices) do
79 -- collectd_netlink.filters (Filter)
80 filters = s:option( MultiValue, "Filters", translate("Filter class monitoring") )
81 filters.widget = "select"
82 filters.optional = true
83 filters.size = #devices + 1
84 filters:depends( "enable", 1 )
86 for i, v in ipairs(devices) do
90 -- collectd_netlink.ignoreselected (IgnoreSelected)
91 ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
92 ignoreselected.default = 0
93 ignoreselected:depends( "enable", 1 )