-module("ffluci.controller.luci_statistics.luci_statistics", package.seeall)
+module("luci.controller.luci_statistics.luci_statistics", package.seeall)
-local fs = require("ffluci.fs")
-local tpl = require("ffluci.template")
-local rrd = require("ffluci.statistics.rrdtool")
-local data = require("ffluci.statistics.datatree").Instance()
+local fs = require("luci.fs")
+local tpl = require("luci.template")
+local rrd = require("luci.statistics.rrdtool")
+local data = require("luci.statistics.datatree").Instance()
function _entry( path, ... )
function statistics_render()
- local plugin = ffluci.dispatcher.request[3]
+ local plugin = luci.dispatcher.request[3]
local images = { }
for i, inst in ipairs( data:plugin_instances( plugin ) ) do
]]--
-require("ffluci.sys")
+require("luci.sys")
m = Map("luci_statistics", "Collector Daemon",
-- general.hostname (Hostname)
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
-- general.fqdnlookup (FQDNLookup)
]]--
-require("ffluci.sys")
+require("luci.sys")
m = Map("luci_statistics", "DNS Plugin",
interfaces = s:option( ListValue, "Interface", "Folgende Schnittstelle überwachen:" )
interfaces:depends( "enable", 1 )
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)
end
]]--
-require("ffluci.sys")
+require("luci.sys")
m = Map("luci_statistics", "Interface Plugin",
interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" )
interfaces.widget = "select"
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)
end
]]--
-require("ffluci.sys.iptparser")
+require("luci.sys.iptparser")
-ip = ffluci.sys.iptparser.IptParser()
+ip = luci.sys.iptparser.IptParser()
chains = { }
targets = { }
]]--
-require("ffluci.sys")
+require("luci.sys")
m = Map("luci_statistics", "Interface Plugin",
interfaces.optional = true
interfaces:depends( "enable", 1 )
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)
end
verboseinterfaces.optional = true
verboseinterfaces:depends( "enable", 1 )
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)
end
qdiscs.optional = true
qdiscs:depends( "enable", 1 )
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)
end
classs.optional = true
classs:depends( "enable", 1 )
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)
end
filters.optional = true
filters:depends( "enable", 1 )
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)
end
-module("ffluci.statistics.datatree", package.seeall)
+module("luci.statistics.datatree", package.seeall)
-local util = require("ffluci.util")
-local sys = require("ffluci.sys")
-local fs = require("ffluci.fs")
-local uci = require("ffluci.model.uci").Session()
+local util = require("luci.util")
+local sys = require("luci.sys")
+local fs = require("luci.fs")
+local uci = require("luci.model.uci").Session()
local sections, names = uci:sections( "luci_statistics" )
-module("ffluci.statistics.rrdtool", package.seeall)
+module("luci.statistics.rrdtool", package.seeall)
-require("ffluci.statistics.datatree")
-require("ffluci.statistics.rrdtool.colors")
-require("ffluci.statistics.rrdtool.definitions")
-require("ffluci.util")
-require("ffluci.bits")
-require("ffluci.fs")
+require("luci.statistics.datatree")
+require("luci.statistics.rrdtool.colors")
+require("luci.statistics.rrdtool.definitions")
+require("luci.util")
+require("luci.bits")
+require("luci.fs")
-Graph = ffluci.util.class()
+Graph = luci.util.class()
function Graph.__init__( self, timespan, opts )
opts = opts or { }
opts.width = opts.width or "400"
- self.colors = ffluci.statistics.rrdtool.colors.Instance()
- self.defs = ffluci.statistics.rrdtool.definitions.Instance()
- self.tree = ffluci.statistics.datatree.Instance()
+ self.colors = luci.statistics.rrdtool.colors.Instance()
+ self.defs = luci.statistics.rrdtool.definitions.Instance()
+ self.tree = luci.statistics.datatree.Instance()
-- rrdtool defalt args
self.args = {
-- prepare directory
local dir = png:gsub("/[^/]+$","")
- ffluci.fs.mkdir( dir, true )
+ luci.fs.mkdir( dir, true )
-- construct commandline
local cmdline = "rrdtool graph " .. png
local pngs = { }
-- 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 )
if stat and def and type(def.rrdargs) == "function" then
-module("ffluci.statistics.rrdtool.colors", package.seeall)
+module("luci.statistics.rrdtool.colors", package.seeall)
-require("ffluci.util")
-require("ffluci.bits")
+require("luci.util")
+require("luci.bits")
-Instance = ffluci.util.class()
+Instance = luci.util.class()
function Instance.from_string( self, s )
return {
- ffluci.bits.Hex2Dec(s:sub(1,2)),
- ffluci.bits.Hex2Dec(s:sub(3,4)),
- ffluci.bits.Hex2Dec(s:sub(5,6))
+ luci.bits.Hex2Dec(s:sub(1,2)),
+ luci.bits.Hex2Dec(s:sub(3,4)),
+ luci.bits.Hex2Dec(s:sub(5,6))
}
end
-module("ffluci.statistics.rrdtool.definitions", package.seeall)
+module("luci.statistics.rrdtool.definitions", package.seeall)
-require("ffluci.util")
-require("ffluci.fs")
+require("luci.util")
+require("luci.fs")
-Instance = ffluci.util.class()
+Instance = luci.util.class()
function Instance.__init__( self, ... )
-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 )
-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 )
-module("ffluci.statistics.rrdtool.definitions.netlink", package.seeall)
+module("luci.statistics.rrdtool.definitions.netlink", package.seeall)
function rrdargs( graph, host, plugin, plugin_instance )
-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 )
-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 )
-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 )
-module("ffluci.statistics.rrdtool.definitions.wireless", package.seeall)
+module("luci.statistics.rrdtool.definitions.wireless", package.seeall)
function rrdargs( graph, host, plugin, plugin_instance )
<p><%:stat_networkplugins_installed Installierte Netzwerkplugins:%>
<ul>
<% for plugin, desc in pairs(plugins) do %>
- <% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
- <li><a href="/cgi-bin/ffluci/admin/statistics/network/<%=plugin%>"><%=desc%></a></li>
+ <% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
+ <li><a href="/cgi-bin/luci/admin/statistics/network/<%=plugin%>"><%=desc%></a></li>
<% end %>
<% end %>
</ul>
<p><%:stat_outputplugins_installed Installierte Ausgabeplugins:%>
<ul>
<% for plugin, desc in pairs(plugins) do %>
- <% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
- <li><a href="/cgi-bin/ffluci/admin/statistics/output/<%=plugin%>"><%=desc%></a></li>
+ <% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
+ <li><a href="/cgi-bin/luci/admin/statistics/output/<%=plugin%>"><%=desc%></a></li>
<% end %>
<% end %>
</ul>
<p><%:stat_systemplugins_installed Installierte Systemplugins:%>
<ul>
<% for plugin, desc in pairs(plugins) do %>
- <% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
- <li><a href="/cgi-bin/ffluci/admin/statistics/system/<%=plugin%>"><%=desc%></a></li>
+ <% if luci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %>
+ <li><a href="/cgi-bin/luci/admin/statistics/system/<%=plugin%>"><%=desc%></a></li>
<% end %>
<% end %>
</ul>