From 6c487cde9ad77a5b6d6d3fed37229b2f9b83528b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 7 Dec 2011 21:08:49 +0000 Subject: [PATCH] applications/luci-statistics: drop support for wireless plugin, add iwinfo replacement --- .../luci_statistics/luci_statistics.lua | 5 +- .../model/cbi/luci_statistics/iwinfo.lua | 38 +++++++ .../model/cbi/luci_statistics/wireless.lua | 30 ------ .../statistics/rrdtool/definitions/iwinfo.lua | 102 ++++++++++++++++++ .../rrdtool/definitions/wireless.lua | 78 -------------- 5 files changed, 142 insertions(+), 111 deletions(-) create mode 100644 applications/luci-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua delete mode 100644 applications/luci-statistics/luasrc/model/cbi/luci_statistics/wireless.lua create mode 100644 applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua delete mode 100644 applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua diff --git a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua index dea161887..a49c40492 100644 --- a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua +++ b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua @@ -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 diff --git a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua new file mode 100644 index 000000000..5e9340dc4 --- /dev/null +++ b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua @@ -0,0 +1,38 @@ +--[[ + +Luci configuration model for statistics - collectd interface plugin configuration +(c) 2011 Jo-Philipp Wich + +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 diff --git a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/wireless.lua b/applications/luci-statistics/luasrc/model/cbi/luci_statistics/wireless.lua deleted file mode 100644 index f971c8cfc..000000000 --- a/applications/luci-statistics/luasrc/model/cbi/luci_statistics/wireless.lua +++ /dev/null @@ -1,30 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd wireless plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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 diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua new file mode 100644 index 000000000..54c869f7f --- /dev/null +++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua @@ -0,0 +1,102 @@ +--[[ + +Luci statistics - wireless plugin diagram definition +(c) 2011 Jo-Philipp Wich + +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 diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua deleted file mode 100644 index 7daddab67..000000000 --- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua +++ /dev/null @@ -1,78 +0,0 @@ ---[[ - -Luci statistics - wireless plugin diagram definition -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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 -- 2.25.1