* luci/statistics: ffluci -> luci conversation
This commit is contained in:
parent
4a80f37832
commit
bf907eafda
20 changed files with 62 additions and 62 deletions
|
@ -1,9 +1,9 @@
|
||||||
module("ffluci.controller.luci_statistics.luci_statistics", package.seeall)
|
module("luci.controller.luci_statistics.luci_statistics", package.seeall)
|
||||||
|
|
||||||
local fs = require("ffluci.fs")
|
local fs = require("luci.fs")
|
||||||
local tpl = require("ffluci.template")
|
local tpl = require("luci.template")
|
||||||
local rrd = require("ffluci.statistics.rrdtool")
|
local rrd = require("luci.statistics.rrdtool")
|
||||||
local data = require("ffluci.statistics.datatree").Instance()
|
local data = require("luci.statistics.datatree").Instance()
|
||||||
|
|
||||||
|
|
||||||
function _entry( path, ... )
|
function _entry( path, ... )
|
||||||
|
@ -93,7 +93,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
function statistics_render()
|
function statistics_render()
|
||||||
local plugin = ffluci.dispatcher.request[3]
|
local plugin = luci.dispatcher.request[3]
|
||||||
local images = { }
|
local images = { }
|
||||||
|
|
||||||
for i, inst in ipairs( data:plugin_instances( plugin ) ) do
|
for i, inst in ipairs( data:plugin_instances( plugin ) ) do
|
||||||
|
|
|
@ -13,7 +13,7 @@ $Id$
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
require("ffluci.sys")
|
require("luci.sys")
|
||||||
|
|
||||||
|
|
||||||
m = Map("luci_statistics", "Collector Daemon",
|
m = Map("luci_statistics", "Collector Daemon",
|
||||||
|
@ -56,7 +56,7 @@ readthreads.isnumber = true
|
||||||
|
|
||||||
-- general.hostname (Hostname)
|
-- general.hostname (Hostname)
|
||||||
hostname = s:option( Value, "Hostname", "Hostname zur Identifikation des Collector Dienstes (leer lassen um den Namen automatisch zu bestimmen)" )
|
hostname = s:option( Value, "Hostname", "Hostname zur Identifikation des Collector Dienstes (leer lassen um den Namen automatisch zu bestimmen)" )
|
||||||
hostname.default = ffluci.sys.hostname()
|
hostname.default = luci.sys.hostname()
|
||||||
hostname.optional = true
|
hostname.optional = true
|
||||||
|
|
||||||
-- general.fqdnlookup (FQDNLookup)
|
-- general.fqdnlookup (FQDNLookup)
|
||||||
|
|
|
@ -13,7 +13,7 @@ $Id$
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
require("ffluci.sys")
|
require("luci.sys")
|
||||||
|
|
||||||
|
|
||||||
m = Map("luci_statistics", "DNS Plugin",
|
m = Map("luci_statistics", "DNS Plugin",
|
||||||
|
@ -30,7 +30,7 @@ enable.default = 0
|
||||||
interfaces = s:option( ListValue, "Interface", "Folgende Schnittstelle überwachen:" )
|
interfaces = s:option( ListValue, "Interface", "Folgende Schnittstelle überwachen:" )
|
||||||
interfaces:depends( "enable", 1 )
|
interfaces:depends( "enable", 1 )
|
||||||
interfaces:value("any")
|
interfaces:value("any")
|
||||||
for k, v in pairs(ffluci.sys.net.devices()) do
|
for k, v in pairs(luci.sys.net.devices()) do
|
||||||
interfaces:value(v)
|
interfaces:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ $Id$
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
require("ffluci.sys")
|
require("luci.sys")
|
||||||
|
|
||||||
|
|
||||||
m = Map("luci_statistics", "Interface Plugin",
|
m = Map("luci_statistics", "Interface Plugin",
|
||||||
|
@ -30,7 +30,7 @@ enable.default = 0
|
||||||
interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" )
|
interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" )
|
||||||
interfaces.widget = "select"
|
interfaces.widget = "select"
|
||||||
interfaces:depends( "enable", 1 )
|
interfaces:depends( "enable", 1 )
|
||||||
for k, v in pairs(ffluci.sys.net.devices()) do
|
for k, v in pairs(luci.sys.net.devices()) do
|
||||||
interfaces:value(v)
|
interfaces:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@ $Id$
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
require("ffluci.sys.iptparser")
|
require("luci.sys.iptparser")
|
||||||
|
|
||||||
ip = ffluci.sys.iptparser.IptParser()
|
ip = luci.sys.iptparser.IptParser()
|
||||||
chains = { }
|
chains = { }
|
||||||
targets = { }
|
targets = { }
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ $Id$
|
||||||
|
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
require("ffluci.sys")
|
require("luci.sys")
|
||||||
|
|
||||||
|
|
||||||
m = Map("luci_statistics", "Interface Plugin",
|
m = Map("luci_statistics", "Interface Plugin",
|
||||||
|
@ -32,7 +32,7 @@ interfaces.widget = "select"
|
||||||
interfaces.optional = true
|
interfaces.optional = true
|
||||||
interfaces:depends( "enable", 1 )
|
interfaces:depends( "enable", 1 )
|
||||||
interfaces:value("")
|
interfaces:value("")
|
||||||
for i, v in ipairs(ffluci.sys.net.devices()) do
|
for i, v in ipairs(luci.sys.net.devices()) do
|
||||||
interfaces:value(v)
|
interfaces:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ verboseinterfaces.widget = "select"
|
||||||
verboseinterfaces.optional = true
|
verboseinterfaces.optional = true
|
||||||
verboseinterfaces:depends( "enable", 1 )
|
verboseinterfaces:depends( "enable", 1 )
|
||||||
verboseinterfaces:value("")
|
verboseinterfaces:value("")
|
||||||
for i, v in ipairs(ffluci.sys.net.devices()) do
|
for i, v in ipairs(luci.sys.net.devices()) do
|
||||||
verboseinterfaces:value(v)
|
verboseinterfaces:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ qdiscs.widget = "select"
|
||||||
qdiscs.optional = true
|
qdiscs.optional = true
|
||||||
qdiscs:depends( "enable", 1 )
|
qdiscs:depends( "enable", 1 )
|
||||||
qdiscs:value("")
|
qdiscs:value("")
|
||||||
for i, v in ipairs(ffluci.sys.net.devices()) do
|
for i, v in ipairs(luci.sys.net.devices()) do
|
||||||
qdiscs:value(v)
|
qdiscs:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ classs.widget = "select"
|
||||||
classs.optional = true
|
classs.optional = true
|
||||||
classs:depends( "enable", 1 )
|
classs:depends( "enable", 1 )
|
||||||
classs:value("")
|
classs:value("")
|
||||||
for i, v in ipairs(ffluci.sys.net.devices()) do
|
for i, v in ipairs(luci.sys.net.devices()) do
|
||||||
classs:value(v)
|
classs:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ filters.widget = "select"
|
||||||
filters.optional = true
|
filters.optional = true
|
||||||
filters:depends( "enable", 1 )
|
filters:depends( "enable", 1 )
|
||||||
filters:value("")
|
filters:value("")
|
||||||
for i, v in ipairs(ffluci.sys.net.devices()) do
|
for i, v in ipairs(luci.sys.net.devices()) do
|
||||||
filters:value(v)
|
filters:value(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
module("ffluci.statistics.datatree", package.seeall)
|
module("luci.statistics.datatree", package.seeall)
|
||||||
|
|
||||||
local util = require("ffluci.util")
|
local util = require("luci.util")
|
||||||
local sys = require("ffluci.sys")
|
local sys = require("luci.sys")
|
||||||
local fs = require("ffluci.fs")
|
local fs = require("luci.fs")
|
||||||
local uci = require("ffluci.model.uci").Session()
|
local uci = require("luci.model.uci").Session()
|
||||||
local sections, names = uci:sections( "luci_statistics" )
|
local sections, names = uci:sections( "luci_statistics" )
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
module("ffluci.statistics.rrdtool", package.seeall)
|
module("luci.statistics.rrdtool", package.seeall)
|
||||||
|
|
||||||
require("ffluci.statistics.datatree")
|
require("luci.statistics.datatree")
|
||||||
require("ffluci.statistics.rrdtool.colors")
|
require("luci.statistics.rrdtool.colors")
|
||||||
require("ffluci.statistics.rrdtool.definitions")
|
require("luci.statistics.rrdtool.definitions")
|
||||||
require("ffluci.util")
|
require("luci.util")
|
||||||
require("ffluci.bits")
|
require("luci.bits")
|
||||||
require("ffluci.fs")
|
require("luci.fs")
|
||||||
|
|
||||||
|
|
||||||
Graph = ffluci.util.class()
|
Graph = luci.util.class()
|
||||||
|
|
||||||
function Graph.__init__( self, timespan, opts )
|
function Graph.__init__( self, timespan, opts )
|
||||||
|
|
||||||
opts = opts or { }
|
opts = opts or { }
|
||||||
opts.width = opts.width or "400"
|
opts.width = opts.width or "400"
|
||||||
|
|
||||||
self.colors = ffluci.statistics.rrdtool.colors.Instance()
|
self.colors = luci.statistics.rrdtool.colors.Instance()
|
||||||
self.defs = ffluci.statistics.rrdtool.definitions.Instance()
|
self.defs = luci.statistics.rrdtool.definitions.Instance()
|
||||||
self.tree = ffluci.statistics.datatree.Instance()
|
self.tree = luci.statistics.datatree.Instance()
|
||||||
|
|
||||||
-- rrdtool defalt args
|
-- rrdtool defalt args
|
||||||
self.args = {
|
self.args = {
|
||||||
|
@ -77,7 +77,7 @@ function Graph._rrdtool( self, png, rrd )
|
||||||
|
|
||||||
-- prepare directory
|
-- prepare directory
|
||||||
local dir = png:gsub("/[^/]+$","")
|
local dir = png:gsub("/[^/]+$","")
|
||||||
ffluci.fs.mkdir( dir, true )
|
luci.fs.mkdir( dir, true )
|
||||||
|
|
||||||
-- construct commandline
|
-- construct commandline
|
||||||
local cmdline = "rrdtool graph " .. png
|
local cmdline = "rrdtool graph " .. png
|
||||||
|
@ -195,7 +195,7 @@ function Graph.render( self, host, plugin, plugin_instance )
|
||||||
local pngs = { }
|
local pngs = { }
|
||||||
|
|
||||||
-- check for a whole graph handler
|
-- check for a whole graph handler
|
||||||
local plugin_def = "ffluci.statistics.rrdtool.definitions." .. plugin
|
local plugin_def = "luci.statistics.rrdtool.definitions." .. plugin
|
||||||
local stat, def = pcall( require, plugin_def )
|
local stat, def = pcall( require, plugin_def )
|
||||||
|
|
||||||
if stat and def and type(def.rrdargs) == "function" then
|
if stat and def and type(def.rrdargs) == "function" then
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
module("ffluci.statistics.rrdtool.colors", package.seeall)
|
module("luci.statistics.rrdtool.colors", package.seeall)
|
||||||
|
|
||||||
require("ffluci.util")
|
require("luci.util")
|
||||||
require("ffluci.bits")
|
require("luci.bits")
|
||||||
|
|
||||||
|
|
||||||
Instance = ffluci.util.class()
|
Instance = luci.util.class()
|
||||||
|
|
||||||
function Instance.from_string( self, s )
|
function Instance.from_string( self, s )
|
||||||
return {
|
return {
|
||||||
ffluci.bits.Hex2Dec(s:sub(1,2)),
|
luci.bits.Hex2Dec(s:sub(1,2)),
|
||||||
ffluci.bits.Hex2Dec(s:sub(3,4)),
|
luci.bits.Hex2Dec(s:sub(3,4)),
|
||||||
ffluci.bits.Hex2Dec(s:sub(5,6))
|
luci.bits.Hex2Dec(s:sub(5,6))
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions", package.seeall)
|
module("luci.statistics.rrdtool.definitions", package.seeall)
|
||||||
|
|
||||||
require("ffluci.util")
|
require("luci.util")
|
||||||
require("ffluci.fs")
|
require("luci.fs")
|
||||||
|
|
||||||
|
|
||||||
Instance = ffluci.util.class()
|
Instance = luci.util.class()
|
||||||
|
|
||||||
function Instance.__init__( self, ... )
|
function Instance.__init__( self, ... )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.cpu.cpu",package.seeall)
|
module("luci.statistics.rrdtool.definitions.cpu.cpu",package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.iptables.ipt_packets", package.seeall)
|
module("luci.statistics.rrdtool.definitions.iptables.ipt_packets", package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.netlink", package.seeall)
|
module("luci.statistics.rrdtool.definitions.netlink", package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance )
|
function rrdargs( graph, host, plugin, plugin_instance )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.ping.ping", package.seeall)
|
module("luci.statistics.rrdtool.definitions.ping.ping", package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.processes.ps_state", package.seeall)
|
module("luci.statistics.rrdtool.definitions.processes.ps_state", package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.tcpconns.tcp_connections", package.seeall)
|
module("luci.statistics.rrdtool.definitions.tcpconns.tcp_connections", package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
function rrdargs( graph, host, plugin, plugin_instance, dtype )
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module("ffluci.statistics.rrdtool.definitions.wireless", package.seeall)
|
module("luci.statistics.rrdtool.definitions.wireless", package.seeall)
|
||||||
|
|
||||||
function rrdargs( graph, host, plugin, plugin_instance )
|
function rrdargs( graph, host, plugin, plugin_instance )
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ auf verschiedenen Schnittstellen, DNS-Verkehr u.v.m.%></p>
|
||||||
<p><%:stat_networkplugins_installed Installierte Netzwerkplugins:%>
|
<p><%:stat_networkplugins_installed Installierte Netzwerkplugins:%>
|
||||||
<ul>
|
<ul>
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
<% for plugin, desc in pairs(plugins) do %>
|
||||||
<% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
||||||
<li><a href="/cgi-bin/ffluci/admin/statistics/network/<%=plugin%>"><%=desc%></a></li>
|
<li><a href="/cgi-bin/luci/admin/statistics/network/<%=plugin%>"><%=desc%></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -9,8 +9,8 @@ die gesammelten Werte in RRD-Datenbanken zu sichern und zusätzlich über das Ne
|
||||||
<p><%:stat_outputplugins_installed Installierte Ausgabeplugins:%>
|
<p><%:stat_outputplugins_installed Installierte Ausgabeplugins:%>
|
||||||
<ul>
|
<ul>
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
<% for plugin, desc in pairs(plugins) do %>
|
||||||
<% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
||||||
<li><a href="/cgi-bin/ffluci/admin/statistics/output/<%=plugin%>"><%=desc%></a></li>
|
<li><a href="/cgi-bin/luci/admin/statistics/output/<%=plugin%>"><%=desc%></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -8,8 +8,8 @@ auf dem Gerät.%></p>
|
||||||
<p><%:stat_systemplugins_installed Installierte Systemplugins:%>
|
<p><%:stat_systemplugins_installed Installierte Systemplugins:%>
|
||||||
<ul>
|
<ul>
|
||||||
<% for plugin, desc in pairs(plugins) do %>
|
<% for plugin, desc in pairs(plugins) do %>
|
||||||
<% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
<% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
|
||||||
<li><a href="/cgi-bin/ffluci/admin/statistics/system/<%=plugin%>"><%=desc%></a></li>
|
<li><a href="/cgi-bin/luci/admin/statistics/system/<%=plugin%>"><%=desc%></a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue