applications/luci-statistics: drop support for wireless plugin, add iwinfo replacement

This commit is contained in:
Jo-Philipp Wich 2011-12-07 21:08:49 +00:00
parent b39ea9e637
commit 6c487cde9a
5 changed files with 142 additions and 111 deletions

View file

@ -58,15 +58,14 @@ function index()
processes = _("Processes"),
rrdtool = _("RRDTool"),
tcpconns = _("TCP Connections"),
unixsock = _("UnixSock"),
wireless = _("Wireless")
unixsock = _("UnixSock")
}
-- our collectd menu
local collectd_menu = {
output = { "csv", "network", "rrdtool", "unixsock" },
system = { "cpu", "df", "disk", "email", "exec", "irq", "load", "memory", "processes" },
network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "tcpconns", "wireless", "iwinfo" }
network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "tcpconns", "iwinfo" }
}
-- create toplevel menu nodes

View file

@ -0,0 +1,38 @@
--[[
Luci configuration model for statistics - collectd interface plugin configuration
(c) 2011 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local m, s, o
m = Map("luci_statistics",
translate("Wireless iwinfo Plugin Configuration"),
translate("The iwinfo plugin collects statistics about wireless signal strength, noise and quality."))
s = m:section(NamedSection, "collectd_iwinfo", "luci_statistics")
o = s:option(Flag, "enable", translate("Enable this plugin"))
o.default = 0
o = s:option(Value, "Interfaces", translate("Monitor interfaces"),
translate("Leave unselected to automatically determine interfaces to monitor."))
o.template = "cbi/network_ifacelist"
o.widget = "checkbox"
o.nocreate = true
o:depends("enable", 1)
o = s:option(Flag, "IgnoreSelected", translate("Monitor all except specified"))
o.default = 0
o:depends("enable", 1)
return m

View file

@ -1,30 +0,0 @@
--[[
Luci configuration model for statistics - collectd wireless plugin configuration
(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
m = Map("luci_statistics",
translate("Wireless Plugin Configuration"),
translate(
"The wireless plugin collects statistics about wireless signal " ..
"strength, noise and quality."
))
-- collectd_wireless config section
s = m:section( NamedSection, "collectd_wireless", "luci_statistics" )
-- collectd_wireless.enable
enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0
return m

View file

@ -0,0 +1,102 @@
--[[
Luci statistics - wireless plugin diagram definition
(c) 2011 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
module("luci.statistics.rrdtool.definitions.iwinfo", package.seeall)
function rrdargs( graph, host, plugin, plugin_instance )
--
-- signal/noise diagram
--
local snr = {
title = "%H: Signal and noise on %pi",
vlabel = "dBm",
number_format = "%5.1lf dBm",
data = {
types = { "signal_noise", "signal_power" },
options = {
signal_power = {
title = "Signal",
overlay = true,
color = "0000ff"
},
signal_noise = {
title = "Noise",
overlay = true,
color = "ff0000"
}
}
}
}
--
-- signal quality diagram
--
local quality = {
title = "%H: Signal quality on %pi",
vlabel = "Quality",
number_format = "%3.0lf",
data = {
types = { "signal_quality" },
options = {
signal_quality = {
title = "Quality",
noarea = true,
color = "0000ff"
}
}
}
}
--
-- phy rate diagram
--
local bitrate = {
title = "%H: Average phy rate on %pi",
vlabel = "MBit/s",
number_format = "%5.1lf%sBit/s",
data = {
types = { "bitrate" },
options = {
bitrate = {
title = "Rate",
color = "00ff00"
}
}
}
}
--
-- associated stations
--
local stations = {
title = "%H: Associated stations on %pi",
vlabel = "Stations",
number_format = "%3.0lf",
data = {
types = { "stations" },
options = {
stations = {
title = "Stations",
color = "0000ff"
}
}
}
}
return { snr, quality, bitrate, stations }
end

View file

@ -1,78 +0,0 @@
--[[
Luci statistics - wireless plugin diagram definition
(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
module("luci.statistics.rrdtool.definitions.wireless", package.seeall)
function rrdargs( graph, host, plugin, plugin_instance )
--
-- signal/noise diagram
--
local snr = {
-- draw this diagram for each data instance
per_instance = true,
-- diagram data description
title = "%H: Signal to Noise Ratio on %pi",
vlabel = "dBm",
data = {
types = { "signal_noise", "signal_power" },
-- special options for single data lines
options = {
signal_power = {
overlay = true, -- don't summarize
color = "0000ff", -- power is blue
title = "Signal",
},
signal_noise = {
overlay = true, -- don't summarize
color = "ff0000", -- noise is red
title = "Noise",
}
}
}
}
--
-- signal quality diagram
--
local quality = {
-- draw this diagram for each data instance
per_instance = true,
title = "%H: Signal Quality on %pi",
vlabel = "n",
-- diagram data description
data = {
types = { "signal_quality" },
-- special options for single data lines
options = {
signal_quality = {
noarea = true, -- don't draw area
color = "0000ff", -- quality is blue
title = "Signal Quality"
}
}
}
}
return { snr, quality }
end