applications/luci-statistics: fix translations of cbi models and controller

This commit is contained in:
Jo-Philipp Wich 2010-04-13 20:42:26 +00:00
parent 9ed5a0d6fa
commit f271588cd7
21 changed files with 308 additions and 133 deletions

View file

@ -37,10 +37,33 @@ function index()
end end
end end
-- override i18n(): try to translate stat_<str> or fall back to <str> local translate = luci.i18n.translate
function _i18n( str )
return luci.i18n.translate( "stat_" .. str, str ) local labels = {
end s_output = translate("Output plugins"),
s_system = translate("System plugins"),
s_network = translate("Network plugins"),
rrdtool = translate("RRDTool"),
network = translate("Network"),
unixsock = translate("UnixSock"),
csv = translate("CSV Output"),
exec = translate("Exec"),
email = translate("Email"),
cpu = translate("Processor"),
df = translate("Disk Space Usage"),
disk = translate("Disk Usage"),
irq = translate("Interrupts"),
processes = translate("Processes"),
load = translate("System Load"),
interface = translate("Interfaces"),
netlink = translate("Netlink"),
iptables = translate("Firewall"),
tcpconns = translate("TCP Connections"),
ping = translate("Ping"),
dns = translate("DNS"),
wireless = translate("Wireless")
}
-- our collectd menu -- our collectd menu
local collectd_menu = { local collectd_menu = {
@ -50,11 +73,11 @@ function index()
} }
-- create toplevel menu nodes -- create toplevel menu nodes
local st = entry({"admin", "statistics"}, call("statistics_index"), _i18n("Statistics"), 80) local st = entry({"admin", "statistics"}, call("statistics_index"), translate("Statistics"), 80)
st.i18n = "statistics" st.i18n = "statistics"
st.index = true st.index = true
entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _i18n("collectd"), 10).subindex = true entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), translate("Collectd"), 10).subindex = true
-- populate collectd plugin menu -- populate collectd plugin menu
@ -63,16 +86,14 @@ function index()
entry( entry(
{ "admin", "statistics", "collectd", section }, { "admin", "statistics", "collectd", section },
call( "statistics_" .. section .. "plugins" ), call( "statistics_" .. section .. "plugins" ),
_i18n( section .. "plugins" ), labels["s_"..section], index * 10
index * 10
).index = true ).index = true
for j, plugin in luci.util.vspairs( plugins ) do for j, plugin in luci.util.vspairs( plugins ) do
_entry( _entry(
{ "admin", "statistics", "collectd", section, plugin }, { "admin", "statistics", "collectd", section, plugin },
cbi("luci_statistics/" .. plugin ), cbi("luci_statistics/" .. plugin ),
_i18n( plugin ), labels[plugin], j * 10
j * 10
) )
end end
@ -80,7 +101,7 @@ function index()
end end
-- output views -- output views
local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), _i18n("graphs"), 80) local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), translate("Graphs"), 80)
page.i18n = "statistics" page.i18n = "statistics"
page.setuser = "nobody" page.setuser = "nobody"
page.setgroup = "nogroup" page.setgroup = "nogroup"
@ -96,7 +117,7 @@ function index()
-- plugin menu entry -- plugin menu entry
entry( entry(
{ "admin", "statistics", "graph", plugin }, { "admin", "statistics", "graph", plugin },
call("statistics_render"), _i18n( plugin ), i call("statistics_render"), labels[plugin], i
).query = { timespan = span } ).query = { timespan = span }
-- if more then one instance is found then generate submenu -- if more then one instance is found then generate submenu
@ -117,31 +138,44 @@ function statistics_index()
end end
function statistics_outputplugins() function statistics_outputplugins()
local plugins = { } local translate = luci.i18n.translate
local plugins = {
for i, p in ipairs({ "rrdtool", "network", "unixsock", "csv" }) do rrdtool = translate("RRDTool"),
plugins[p] = luci.i18n.translate( "stat_" .. p, p ) network = translate("Network"),
end unixsock = translate("UnixSock"),
csv = translate("CSV Output")
}
luci.template.render("admin_statistics/outputplugins", {plugins=plugins}) luci.template.render("admin_statistics/outputplugins", {plugins=plugins})
end end
function statistics_systemplugins() function statistics_systemplugins()
local plugins = { } local translate = luci.i18n.translate
local plugins = {
for i, p in ipairs({ "exec", "email", "df", "disk", "irq", "processes", "cpu" }) do exec = translate("Exec"),
plugins[p] = luci.i18n.translate( "stat_" .. p, p ) email = translate("Email"),
end cpu = translate("Processor"),
df = translate("Disk Space Usage"),
disk = translate("Disk Usage"),
irq = translate("Interrupts"),
processes = translate("Processes"),
load = translate("System Load"),
}
luci.template.render("admin_statistics/systemplugins", {plugins=plugins}) luci.template.render("admin_statistics/systemplugins", {plugins=plugins})
end end
function statistics_networkplugins() function statistics_networkplugins()
local plugins = { } local translate = luci.i18n.translate
local plugins = {
for i, p in ipairs({ "interface", "netlink", "iptables", "tcpconns", "ping", "dns", "wireless" }) do interface = translate("Interfaces"),
plugins[p] = luci.i18n.translate( "stat_" .. p, p ) netlink = translate("Netlink"),
end iptables = translate("Firewall"),
tcpconns = translate("TCP Connections"),
ping = translate("Ping"),
dns = translate("DNS"),
wireless = translate("Wireless")
}
luci.template.render("admin_statistics/networkplugins", {plugins=plugins}) luci.template.render("admin_statistics/networkplugins", {plugins=plugins})
end end

View file

@ -16,54 +16,54 @@ $Id$
require("luci.sys") require("luci.sys")
--[[ m = Map("luci_statistics",
m = Map("luci_statistics", "Collector Daemon", translate("Collectd Settings"),
Collectd ist ein kleiner und flexibler Dienst zum Sammeln und Abfragen von Daten translate(
aus verschieden Quellen. Zur weiteren Verarbeitung werden die Daten in RRD Datenbanken "Collectd is a small daeomon for collecting data from " ..
gespeichert oder per Multicast Relaying über das Netzwerk versendet.) "various sources through different plugins. On this page " ..
]]-- "you can change general settings for the collectd daemon."
m = Map("luci_statistics") ))
-- general config section -- general config section
s = m:section( NamedSection, "collectd", "luci_statistics" ) s = m:section( NamedSection, "collectd", "luci_statistics" )
-- general.hostname (Hostname) -- general.hostname (Hostname)
hostname = s:option( Value, "Hostname" ) hostname = s:option( Value, "Hostname", translate("Hostname") )
hostname.default = luci.sys.hostname() hostname.default = luci.sys.hostname()
hostname.optional = true hostname.optional = true
-- general.basedir (BaseDir) -- general.basedir (BaseDir)
basedir = s:option( Value, "BaseDir" ) basedir = s:option( Value, "BaseDir", translate("Base Directory") )
basedir.default = "/var/run/collectd" basedir.default = "/var/run/collectd"
-- general.include (Include) -- general.include (Include)
include = s:option( Value, "Include" ) include = s:option( Value, "Include", translate("Directory for sub-configurations") )
include.default = "/etc/collectd/conf.d/*.conf" include.default = "/etc/collectd/conf.d/*.conf"
-- general.plugindir (PluginDir) -- general.plugindir (PluginDir)
plugindir = s:option( Value, "PluginDir" ) plugindir = s:option( Value, "PluginDir", translate("Directory for collectd plugins") )
plugindir.default = "/usr/lib/collectd/" plugindir.default = "/usr/lib/collectd/"
-- general.pidfile (PIDFile) -- general.pidfile (PIDFile)
pidfile = s:option( Value, "PIDFile" ) pidfile = s:option( Value, "PIDFile", translate("Used PID file") )
pidfile.default = "/var/run/collectd.pid" pidfile.default = "/var/run/collectd.pid"
-- general.typesdb (TypesDB) -- general.typesdb (TypesDB)
typesdb = s:option( Value, "TypesDB" ) typesdb = s:option( Value, "TypesDB", translate("Datasets definition file") )
typesdb.default = "/etc/collectd/types.db" typesdb.default = "/etc/collectd/types.db"
-- general.interval (Interval) -- general.interval (Interval)
interval = s:option( Value, "Interval" ) interval = s:option( Value, "Interval", translate("Data collection interval"), translate("Seconds") )
interval.default = 60 interval.default = 60
interval.isnumber = true interval.isnumber = true
-- general.readthreads (ReadThreads) -- general.readthreads (ReadThreads)
readthreads = s:option( Value, "ReadThreads" ) readthreads = s:option( Value, "ReadThreads", translate("Number of threads for data collection") )
readthreads.default = 5 readthreads.default = 5
readthreads.isnumber = true readthreads.isnumber = true
-- general.fqdnlookup (FQDNLookup) -- general.fqdnlookup (FQDNLookup)
fqdnlookup = s:option( Flag, "FQDNLookup" ) fqdnlookup = s:option( Flag, "FQDNLookup", translate("Try to lookup fully qualified hostname") )
fqdnlookup.enabled = "true" fqdnlookup.enabled = "true"
fqdnlookup.disabled = "false" fqdnlookup.disabled = "false"
fqdnlookup.default = "false" fqdnlookup.default = "false"

View file

@ -13,13 +13,15 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("CPU Plugin Configuration"),
translate("The cpu plugin collects basic statistics about the processor usage."))
-- collectd_cpu config section -- collectd_cpu config section
s = m:section( NamedSection, "collectd_cpu", "luci_statistics" ) s = m:section( NamedSection, "collectd_cpu", "luci_statistics" )
-- collectd_cpu.enable -- collectd_cpu.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
return m return m

View file

@ -13,22 +13,27 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("CSV Plugin Configuration"),
translate(
"The csv plugin stores collected data in csv file format " ..
"for further processing by external programs."
))
-- collectd_csv config section -- collectd_csv config section
s = m:section( NamedSection, "collectd_csv", "luci_statistics" ) s = m:section( NamedSection, "collectd_csv", "luci_statistics" )
-- collectd_csv.enable -- collectd_csv.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_csv.datadir (DataDir) -- collectd_csv.datadir (DataDir)
datadir = s:option( Value, "DataDir" ) datadir = s:option( Value, "DataDir", translate("Storage directory for the csv files") )
datadir.default = "127.0.0.1" datadir.default = "127.0.0.1"
datadir:depends( "enable", 1 ) datadir:depends( "enable", 1 )
-- collectd_csv.storerates (StoreRates) -- collectd_csv.storerates (StoreRates)
storerates = s:option( Flag, "StoreRates" ) storerates = s:option( Flag, "StoreRates", translate("Store data values as rates instead of absolute values") )
storerates.default = 0 storerates.default = 0
storerates:depends( "enable", 1 ) storerates:depends( "enable", 1 )

View file

@ -13,29 +13,34 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("DF Plugin Configuration"),
translate(
"The df plugin collects statistics about the disk space " ..
"usage on different devices, mount points or filesystem types."
))
-- collectd_df config section -- collectd_df config section
s = m:section( NamedSection, "collectd_df", "luci_statistics" ) s = m:section( NamedSection, "collectd_df", "luci_statistics" )
-- collectd_df.enable -- collectd_df.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_df.devices (Device) -- collectd_df.devices (Device)
devices = s:option( Value, "Devices" ) devices = s:option( Value, "Devices", translate("Monitor devices") )
devices.default = "/dev/mtdblock/4" devices.default = "/dev/mtdblock/4"
devices.optional = true devices.optional = true
devices:depends( "enable", 1 ) devices:depends( "enable", 1 )
-- collectd_df.mountpoints (MountPoint) -- collectd_df.mountpoints (MountPoint)
mountpoints = s:option( Value, "MountPoints" ) mountpoints = s:option( Value, "MountPoints", translate("Monitor mount points") )
mountpoints.default = "/jffs" mountpoints.default = "/overlay"
mountpoints.optional = true mountpoints.optional = true
mountpoints:depends( "enable", 1 ) mountpoints:depends( "enable", 1 )
-- collectd_df.fstypes (FSType) -- collectd_df.fstypes (FSType)
fstypes = s:option( Value, "FSTypes" ) fstypes = s:option( Value, "FSTypes", translate("Monitor filesystem types") )
fstypes.default = "tmpfs" fstypes.default = "tmpfs"
fstypes.optional = true fstypes.optional = true
fstypes:depends( "enable", 1 ) fstypes:depends( "enable", 1 )

View file

@ -13,17 +13,22 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Disk Plugin Configuration"),
translate(
"The disk plugin collects detailled usage statistics " ..
"for selected partitions or whole disks."
))
-- collectd_disk config section -- collectd_disk config section
s = m:section( NamedSection, "collectd_disk", "luci_statistics" ) s = m:section( NamedSection, "collectd_disk", "luci_statistics" )
-- collectd_disk.enable -- collectd_disk.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_disk.disks (Disk) -- collectd_disk.disks (Disk)
devices = s:option( Value, "Disks" ) devices = s:option( Value, "Disks", translate("Monitor disks and partitions") )
devices.default = "hda1 hdb" devices.default = "hda1 hdb"
devices.rmempty = true devices.rmempty = true
devices:depends( "enable", 1 ) devices:depends( "enable", 1 )

View file

@ -16,13 +16,18 @@ $Id$
require("luci.sys") require("luci.sys")
m = Map("luci_statistics") m = Map("luci_statistics",
translate("DNS Plugin Configuration"),
translate(
"The dns plugin collects detailled statistics about dns " ..
"related traffic on selected interfaces."
))
-- collectd_dns config section -- collectd_dns config section
s = m:section( NamedSection, "collectd_dns", "luci_statistics" ) s = m:section( NamedSection, "collectd_dns", "luci_statistics" )
-- collectd_dns.enable -- collectd_dns.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_dns.interfaces (Interface) -- collectd_dns.interfaces (Interface)
@ -36,7 +41,7 @@ for k, v in pairs(luci.sys.net.devices()) do
end end
-- collectd_dns.ignoresources (IgnoreSource) -- collectd_dns.ignoresources (IgnoreSource)
ignoresources = s:option( Value, "IgnoreSources" ) ignoresources = s:option( Value, "IgnoreSources", translate("Ignore source addresses") )
ignoresources.default = "127.0.0.1" ignoresources.default = "127.0.0.1"
ignoresources:depends( "enable", 1 ) ignoresources:depends( "enable", 1 )

View file

@ -13,13 +13,21 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("E-Mail Plugin Configuration"),
translate(
"The email plugin creates a unix socket which can be used " ..
"to transmit email-statistics to a running collectd daemon. " ..
"This plugin is primarily intended to be used in conjunction " ..
"with Mail::SpamAssasin::Plugin::Collectd but can be used in " ..
"other ways as well."
))
-- collectd_email config section -- collectd_email config section
s = m:section( NamedSection, "collectd_email", "luci_statistics" ) s = m:section( NamedSection, "collectd_email", "luci_statistics" )
-- collectd_email.enable -- collectd_email.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_email.socketfile (SocketFile) -- collectd_email.socketfile (SocketFile)
@ -42,7 +50,7 @@ socketperms.optional = true
socketperms:depends( "enable", 1 ) socketperms:depends( "enable", 1 )
-- collectd_email.maxconns (MaxConns) -- collectd_email.maxconns (MaxConns)
maxconns = s:option( Value, "MaxConns" ) maxconns = s:option( Value, "MaxConns", translate("Maximum allowed connections") )
maxconns.default = 5 maxconns.default = 5
maxconns.isinteger = true maxconns.isinteger = true
maxconns.rmempty = true maxconns.rmempty = true

View file

@ -13,18 +13,30 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Exec Plugin Configuration"),
translate(
"The exec plugin starts external commands to read values " ..
"from or to notify external processes when certain threshold " ..
"values have been reached."
))
-- collectd_exec config section -- collectd_exec config section
s = m:section( NamedSection, "collectd_exec", "luci_statistics" ) s = m:section( NamedSection, "collectd_exec", "luci_statistics" )
-- collectd_exec.enable -- collectd_exec.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_exec_input config section (Exec directives) -- collectd_exec_input config section (Exec directives)
exec = m:section( TypedSection, "collectd_exec_input" ) exec = m:section( TypedSection, "collectd_exec_input",
translate("Add command for reading values"),
translate(
"Here you can define external commands which will be " ..
"started by collectd in order to read certain values. " ..
"The values will be read from stdout."
))
exec.addremove = true exec.addremove = true
exec.anonymous = true exec.anonymous = true
@ -46,7 +58,14 @@ exec_cmdgroup.optional = true
-- collectd_exec_notify config section (NotifyExec directives) -- collectd_exec_notify config section (NotifyExec directives)
notify = m:section( TypedSection, "collectd_exec_notify" ) notify = m:section( TypedSection, "collectd_exec_notify",
translate("Add notification command"),
translate(
"Here you can define external commands which will be " ..
"started by collectd when certain threshold values have " ..
"been reached. The values leading to invokation will be " ..
"feeded to the the called programs stdin."
))
notify.addremove = true notify.addremove = true
notify.anonymous = true notify.anonymous = true

View file

@ -16,13 +16,18 @@ $Id$
require("luci.sys") require("luci.sys")
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Interface Plugin Configuration"),
translate(
"The interface plugin collects traffic statistics on " ..
"selected interfaces."
))
-- collectd_interface config section -- collectd_interface config section
s = m:section( NamedSection, "collectd_interface", "luci_statistics" ) s = m:section( NamedSection, "collectd_interface", "luci_statistics" )
-- collectd_interface.enable -- collectd_interface.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_interface.interfaces (Interface) -- collectd_interface.interfaces (Interface)

View file

@ -25,27 +25,38 @@ for i, rule in ipairs( ip:find() ) do
end end
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Iptables Plugin Configuration"),
translate(
"The iptables plugin will monitor selected firewall rules and " ..
"collect informations about processed bytes and packets per rule."
))
-- collectd_iptables config section -- collectd_iptables config section
s = m:section( NamedSection, "collectd_iptables", "luci_statistics" ) s = m:section( NamedSection, "collectd_iptables", "luci_statistics" )
-- collectd_iptables.enable -- collectd_iptables.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_iptables_match config section (Chain directives) -- collectd_iptables_match config section (Chain directives)
rule = m:section( TypedSection, "collectd_iptables_match" ) rule = m:section( TypedSection, "collectd_iptables_match",
translate("Add matching rule"),
translate(
"Here you can define various criteria by which the monitored " ..
"iptables rules are selected."
))
rule.addremove = true rule.addremove = true
rule.anonymous = true rule.anonymous = true
-- collectd_iptables_match.name -- collectd_iptables_match.name
rule_table = rule:option( Value, "name" ) rule_table = rule:option( Value, "name",
translate("Name of the rule"), translate("max. 16 chars") )
-- collectd_iptables_match.table -- collectd_iptables_match.table
rule_table = rule:option( ListValue, "table" ) rule_table = rule:option( ListValue, "table", translate("Table") )
rule_table.default = "filter" rule_table.default = "filter"
rule_table.rmempty = true rule_table.rmempty = true
rule_table.optional = true rule_table.optional = true
@ -56,7 +67,7 @@ rule_table:value("mangle")
-- collectd_iptables_match.chain -- collectd_iptables_match.chain
rule_chain = rule:option( ListValue, "chain" ) rule_chain = rule:option( ListValue, "chain", translate("Chain") )
rule_chain.rmempty = true rule_chain.rmempty = true
rule_chain.optional = true rule_chain.optional = true
rule_chain:value("") rule_chain:value("")
@ -67,7 +78,7 @@ end
-- collectd_iptables_match.target -- collectd_iptables_match.target
rule_target = rule:option( ListValue, "target" ) rule_target = rule:option( ListValue, "target", translate("Action (target)") )
rule_target.rmempty = true rule_target.rmempty = true
rule_target.optional = true rule_target.optional = true
rule_target:value("") rule_target:value("")
@ -78,7 +89,7 @@ end
-- collectd_iptables_match.protocol -- collectd_iptables_match.protocol
rule_protocol = rule:option( ListValue, "protocol" ) rule_protocol = rule:option( ListValue, "protocol", translate("Network protocol") )
rule_protocol.rmempty = true rule_protocol.rmempty = true
rule_protocol.optional = true rule_protocol.optional = true
rule_protocol:value("") rule_protocol:value("")
@ -87,29 +98,32 @@ rule_protocol:value("udp")
rule_protocol:value("icmp") rule_protocol:value("icmp")
-- collectd_iptables_match.source -- collectd_iptables_match.source
rule_source = rule:option( Value, "source" ) rule_source = rule:option( Value, "source", translate("Source ip range") )
rule_source.default = "0.0.0.0/0" rule_source.default = "0.0.0.0/0"
rule_source.rmempty = true rule_source.rmempty = true
rule_source.optional = true rule_source.optional = true
-- collectd_iptables_match.destination -- collectd_iptables_match.destination
rule_destination = rule:option( Value, "destination" ) rule_destination = rule:option( Value, "destination", translate("Destination ip range") )
rule_destination.default = "0.0.0.0/0" rule_destination.default = "0.0.0.0/0"
rule_destination.rmempty = true rule_destination.rmempty = true
rule_destination.optional = true rule_destination.optional = true
-- collectd_iptables_match.inputif -- collectd_iptables_match.inputif
rule_inputif = rule:option( Value, "inputif" ) rule_inputif = rule:option( Value, "inputif",
translate("Incoming interface"), translate("e.g. br-lan") )
rule_inputif.rmempty = true rule_inputif.rmempty = true
rule_inputif.optional = true rule_inputif.optional = true
-- collectd_iptables_match.outputif -- collectd_iptables_match.outputif
rule_outputif = rule:option( Value, "outputif" ) rule_outputif = rule:option( Value, "outputif",
translate("Outgoing interface"), translate("e.g. br-ff") )
rule_outputif.rmempty = true rule_outputif.rmempty = true
rule_outputif.optional = true rule_outputif.optional = true
-- collectd_iptables_match.options -- collectd_iptables_match.options
rule_options = rule:option( Value, "options" ) rule_options = rule:option( Value, "options",
translate("Options"), translate("e.g. reject-with tcp-reset") )
rule_options.rmempty = true rule_options.rmempty = true
rule_options.optional = true rule_options.optional = true

View file

@ -13,17 +13,23 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("IRQ Plugin Configuration"),
translate(
"The irq plugin will monitor the rate of issues per second for " ..
"each selected interrupt. If no interrupt is selected then all " ..
"interrupts are monitored."
))
-- collectd_irq config section -- collectd_irq config section
s = m:section( NamedSection, "collectd_irq", "luci_statistics" ) s = m:section( NamedSection, "collectd_irq", "luci_statistics" )
-- collectd_irq.enable -- collectd_irq.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_irq.irqs (Irq) -- collectd_irq.irqs (Irq)
irqs = s:option( Value, "Irqs" ) irqs = s:option( Value, "Irqs", translate("Monitor interrupts") )
irqs.optional = true irqs.optional = true
irqs:depends( "enable", 1 ) irqs:depends( "enable", 1 )

View file

@ -13,13 +13,17 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Load Plugin Configuration"),
translate(
"The load plugin collects statistics about the general system load."
))
-- collectd_wireless config section -- collectd_wireless config section
s = m:section( NamedSection, "collectd_load", "luci_statistics" ) s = m:section( NamedSection, "collectd_load", "luci_statistics" )
-- collectd_wireless.enable -- collectd_wireless.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
return m return m

View file

@ -18,17 +18,22 @@ require("luci.sys")
local devices = luci.sys.net.devices() local devices = luci.sys.net.devices()
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Netlink Plugin Configuration"),
translate(
"The netlink plugin collects extended informations like " ..
"qdisc-, class- and filter-statistics for selected interfaces."
))
-- collectd_netlink config section -- collectd_netlink config section
s = m:section( NamedSection, "collectd_netlink", "luci_statistics" ) s = m:section( NamedSection, "collectd_netlink", "luci_statistics" )
-- collectd_netlink.enable -- collectd_netlink.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_netlink.interfaces (Interface) -- collectd_netlink.interfaces (Interface)
interfaces = s:option( MultiValue, "Interfaces" ) interfaces = s:option( MultiValue, "Interfaces", translate("Basic monitoring") )
interfaces.widget = "select" interfaces.widget = "select"
interfaces.optional = true interfaces.optional = true
interfaces.size = #devices + 1 interfaces.size = #devices + 1
@ -39,7 +44,7 @@ for i, v in ipairs(devices) do
end end
-- collectd_netlink.verboseinterfaces (VerboseInterface) -- collectd_netlink.verboseinterfaces (VerboseInterface)
verboseinterfaces = s:option( MultiValue, "VerboseInterfaces" ) verboseinterfaces = s:option( MultiValue, "VerboseInterfaces", translate("Verbose monitoring") )
verboseinterfaces.widget = "select" verboseinterfaces.widget = "select"
verboseinterfaces.optional = true verboseinterfaces.optional = true
verboseinterfaces.size = #devices + 1 verboseinterfaces.size = #devices + 1
@ -50,7 +55,7 @@ for i, v in ipairs(devices) do
end end
-- collectd_netlink.qdiscs (QDisc) -- collectd_netlink.qdiscs (QDisc)
qdiscs = s:option( MultiValue, "QDiscs" ) qdiscs = s:option( MultiValue, "QDiscs", translate("Qdisc monitoring") )
qdiscs.widget = "select" qdiscs.widget = "select"
qdiscs.optional = true qdiscs.optional = true
qdiscs.size = #devices + 1 qdiscs.size = #devices + 1
@ -61,7 +66,7 @@ for i, v in ipairs(devices) do
end end
-- collectd_netlink.classes (Class) -- collectd_netlink.classes (Class)
classes = s:option( MultiValue, "Classes" ) classes = s:option( MultiValue, "Classes", translate("Shaping class monitoring") )
classes.widget = "select" classes.widget = "select"
classes.optional = true classes.optional = true
classes.size = #devices + 1 classes.size = #devices + 1
@ -72,7 +77,7 @@ for i, v in ipairs(devices) do
end end
-- collectd_netlink.filters (Filter) -- collectd_netlink.filters (Filter)
filters = s:option( MultiValue, "Filters" ) filters = s:option( MultiValue, "Filters", translate("Filter class monitoring") )
filters.widget = "select" filters.widget = "select"
filters.optional = true filters.optional = true
filters.size = #devices + 1 filters.size = #devices + 1

View file

@ -14,62 +14,81 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Network Plugin Configuration"),
translate(
"The network plugin provides network based communication between " ..
"different collectd instances. Collectd can operate both in client " ..
"and server mode. In client mode locally collected date is " ..
"transferred to a collectd server instance, in server mode the " ..
"local instance receives data from other hosts."
))
-- collectd_network config section -- collectd_network config section
s = m:section( NamedSection, "collectd_network", "luci_statistics" ) s = m:section( NamedSection, "collectd_network", "luci_statistics" )
-- collectd_network.enable -- collectd_network.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_network_listen config section (Listen) -- collectd_network_listen config section (Listen)
listen = m:section( TypedSection, "collectd_network_listen" ) listen = m:section( TypedSection, "collectd_network_listen",
translate("Listener interfaces"),
translate(
"This section defines on which interfaces collectd will wait " ..
"for incoming connections."
))
listen.addremove = true listen.addremove = true
listen.anonymous = true listen.anonymous = true
-- collectd_network_listen.host -- collectd_network_listen.host
listen_host = listen:option( Value, "host" ) listen_host = listen:option( Value, "host", translate("Listen host") )
listen_host.default = "0.0.0.0" listen_host.default = "0.0.0.0"
-- collectd_network_listen.port -- collectd_network_listen.port
listen_port = listen:option( Value, "port" ) listen_port = listen:option( Value, "port", translate("Listen port") )
listen_port.default = 25826 listen_port.default = 25826
listen_port.isinteger = true listen_port.isinteger = true
listen_port.optional = true listen_port.optional = true
-- collectd_network_server config section (Server) -- collectd_network_server config section (Server)
server = m:section( TypedSection, "collectd_network_server" ) server = m:section( TypedSection, "collectd_network_server",
translate("server interfaces"),
translate(
"This section defines to which servers the locally collected " ..
"data is sent to."
))
server.addremove = true server.addremove = true
server.anonymous = true server.anonymous = true
-- collectd_network_server.host -- collectd_network_server.host
server_host = server:option( Value, "host" ) server_host = server:option( Value, "host", translate("Server host") )
server_host.default = "0.0.0.0" server_host.default = "0.0.0.0"
-- collectd_network_server.port -- collectd_network_server.port
server_port = server:option( Value, "port" ) server_port = server:option( Value, "port", translate("Server port") )
server_port.default = 25826 server_port.default = 25826
server_port.isinteger = true server_port.isinteger = true
server_port.optional = true server_port.optional = true
-- collectd_network.timetolive (TimeToLive) -- collectd_network.timetolive (TimeToLive)
ttl = s:option( Value, "TimeToLive" ) ttl = s:option( Value, "TimeToLive", translate("TTL for network packets") )
ttl.default = 128 ttl.default = 128
ttl.isinteger = true ttl.isinteger = true
ttl.optional = true ttl.optional = true
ttl:depends( "enable", 1 ) ttl:depends( "enable", 1 )
-- collectd_network.forward (Forward) -- collectd_network.forward (Forward)
forward = s:option( Flag, "Forward" ) forward = s:option( Flag, "Forward", translate("Forwarding between listen and server addresses") )
forward.default = 0 forward.default = 0
forward.optional = true forward.optional = true
forward:depends( "enable", 1 ) forward:depends( "enable", 1 )
-- collectd_network.cacheflush (CacheFlush) -- collectd_network.cacheflush (CacheFlush)
cacheflush = s:option( Value, "CacheFlush" ) cacheflush = s:option( Value, "CacheFlush",
translate("Cache flush interval"), translate("Seconds") )
cacheflush.default = 86400 cacheflush.default = 86400
cacheflush.isinteger = true cacheflush.isinteger = true
cacheflush.optional = true cacheflush.optional = true

View file

@ -13,22 +13,27 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Ping Plugin Configuration"),
translate(
"The ping plugin will send icmp echo replies to selected " ..
"hosts and measure the roundtrip time for each host."
))
-- collectd_ping config section -- collectd_ping config section
s = m:section( NamedSection, "collectd_ping", "luci_statistics" ) s = m:section( NamedSection, "collectd_ping", "luci_statistics" )
-- collectd_ping.enable -- collectd_ping.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_ping.hosts (Host) -- collectd_ping.hosts (Host)
hosts = s:option( Value, "Hosts" ) hosts = s:option( Value, "Hosts", translate("Monitor hosts") )
hosts.default = "127.0.0.1" hosts.default = "127.0.0.1"
hosts:depends( "enable", 1 ) hosts:depends( "enable", 1 )
-- collectd_ping.ttl (TTL) -- collectd_ping.ttl (TTL)
ttl = s:option( Value, "TTL" ) ttl = s:option( Value, "TTL", translate("TTL for ping packets") )
ttl.isinteger = true ttl.isinteger = true
ttl.default = 128 ttl.default = 128
ttl:depends( "enable", 1 ) ttl:depends( "enable", 1 )

View file

@ -13,17 +13,22 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Processes Plugin Configuration"),
translate(
"The processes plugin collects informations like cpu time, " ..
"page faults and memory usage of selected processes."
))
-- collectd_processes config section -- collectd_processes config section
s = m:section( NamedSection, "collectd_processes", "luci_statistics" ) s = m:section( NamedSection, "collectd_processes", "luci_statistics" )
-- collectd_processes.enable -- collectd_processes.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_processes.processes (Process) -- collectd_processes.processes (Process)
processes = s:option( Value, "Processes" ) processes = s:option( Value, "Processes", translate("Monitor processes") )
processes.default = "olsrd bmxd httpd dnsmasq dropbear tinc" processes.default = "olsrd bmxd httpd dnsmasq dropbear tinc"
processes:depends( "enable", 1 ) processes:depends( "enable", 1 )

View file

@ -13,24 +13,33 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("RRDTool Plugin Configuration"),
translate(
"The rrdtool plugin stores the collected data in rrd database " ..
"files, the foundation of the diagrams.<br /><br />" ..
"<strong>Warning: Setting the wrong values will result in a very " ..
"high memory consumption in the temporary directory. " ..
"This can render the device unusable!</strong>"
))
-- collectd_rrdtool config section -- collectd_rrdtool config section
s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics" ) s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics" )
-- collectd_rrdtool.enable -- collectd_rrdtool.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 1 enable.default = 1
-- collectd_rrdtool.datadir (DataDir) -- collectd_rrdtool.datadir (DataDir)
datadir = s:option( Value, "DataDir" ) datadir = s:option( Value, "DataDir", translate("Storage directory") )
datadir.default = "/tmp" datadir.default = "/tmp"
datadir.rmempty = true datadir.rmempty = true
datadir.optional = true datadir.optional = true
datadir:depends( "enable", 1 ) datadir:depends( "enable", 1 )
-- collectd_rrdtool.stepsize (StepSize) -- collectd_rrdtool.stepsize (StepSize)
stepsize = s:option( Value, "StepSize" ) stepsize = s:option( Value, "StepSize",
translate("RRD step interval"), translate("Seconds") )
stepsize.default = 30 stepsize.default = 30
stepsize.isinteger = true stepsize.isinteger = true
stepsize.rmempty = true stepsize.rmempty = true
@ -38,7 +47,8 @@ stepsize.optional = true
stepsize:depends( "enable", 1 ) stepsize:depends( "enable", 1 )
-- collectd_rrdtool.heartbeat (HeartBeat) -- collectd_rrdtool.heartbeat (HeartBeat)
heartbeat = s:option( Value, "HeartBeat" ) heartbeat = s:option( Value, "HeartBeat",
translate("RRD heart beat interval"), translate("Seconds") )
heartbeat.default = 60 heartbeat.default = 60
heartbeat.isinteger = true heartbeat.isinteger = true
heartbeat.rmempty = true heartbeat.rmempty = true
@ -46,21 +56,23 @@ heartbeat.optional = true
heartbeat:depends( "enable", 1 ) heartbeat:depends( "enable", 1 )
-- collectd_rrdtool.rrasingle (RRASingle) -- collectd_rrdtool.rrasingle (RRASingle)
rrasingle = s:option( Flag, "RRASingle" ) rrasingle = s:option( Flag, "RRASingle",
translate("Only create average RRAs"), translate("reduces rrd size") )
rrasingle.default = true rrasingle.default = true
rrasingle.rmempty = true rrasingle.rmempty = true
rrasingle.optional = true rrasingle.optional = true
rrasingle:depends( "enable", 1 ) rrasingle:depends( "enable", 1 )
-- collectd_rrdtool.rratimespans (RRATimespan) -- collectd_rrdtool.rratimespans (RRATimespan)
rratimespans = s:option( Value, "RRATimespans" ) rratimespans = s:option( Value, "RRATimespans",
translate("Stored timespans"), translate("seconds; multiple separated by space") )
rratimespans.default = "600 86400 604800 2678400 31622400" rratimespans.default = "600 86400 604800 2678400 31622400"
rratimespans.rmempty = true rratimespans.rmempty = true
rratimespans.optional = true rratimespans.optional = true
rratimespans:depends( "enable", 1 ) rratimespans:depends( "enable", 1 )
-- collectd_rrdtool.rrarows (RRARows) -- collectd_rrdtool.rrarows (RRARows)
rrarows = s:option( Value, "RRARows" ) rrarows = s:option( Value, "RRARows", translate("Rows per RRA") )
rrarows.isinteger = true rrarows.isinteger = true
rrarows.default = 100 rrarows.default = 100
rrarows.rmempty = true rrarows.rmempty = true
@ -68,7 +80,7 @@ rrarows.optional = true
rrarows:depends( "enable", 1 ) rrarows:depends( "enable", 1 )
-- collectd_rrdtool.xff (XFF) -- collectd_rrdtool.xff (XFF)
xff = s:option( Value, "XFF" ) xff = s:option( Value, "XFF", translate("RRD XFiles Factor") )
xff.default = 0.1 xff.default = 0.1
xff.isnumber = true xff.isnumber = true
xff.rmempty = true xff.rmempty = true
@ -76,7 +88,8 @@ xff.optional = true
xff:depends( "enable", 1 ) xff:depends( "enable", 1 )
-- collectd_rrdtool.cachetimeout (CacheTimeout) -- collectd_rrdtool.cachetimeout (CacheTimeout)
cachetimeout = s:option( Value, "CacheTimeout" ) cachetimeout = s:option( Value, "CacheTimeout",
translate("Cache collected data for"), translate("Seconds") )
cachetimeout.isinteger = true cachetimeout.isinteger = true
cachetimeout.default = 100 cachetimeout.default = 100
cachetimeout.rmempty = true cachetimeout.rmempty = true
@ -84,7 +97,8 @@ cachetimeout.optional = true
cachetimeout:depends( "enable", 1 ) cachetimeout:depends( "enable", 1 )
-- collectd_rrdtool.cacheflush (CacheFlush) -- collectd_rrdtool.cacheflush (CacheFlush)
cacheflush = s:option( Value, "CacheFlush" ) cacheflush = s:option( Value, "CacheFlush",
translate("Flush cache after"), translate("Seconds") )
cacheflush.isinteger = true cacheflush.isinteger = true
cacheflush.default = 100 cacheflush.default = 100
cacheflush.rmempty = true cacheflush.rmempty = true

View file

@ -13,27 +13,32 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("TCPConns Plugin Configuration"),
translate(
"The tcpconns plugin collects informations about open tcp " ..
"connections on selected ports."
))
-- collectd_tcpconns config section -- collectd_tcpconns config section
s = m:section( NamedSection, "collectd_tcpconns", "luci_statistics" ) s = m:section( NamedSection, "collectd_tcpconns", "luci_statistics" )
-- collectd_tcpconns.enable -- collectd_tcpconns.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_tcpconns.listeningports (ListeningPorts) -- collectd_tcpconns.listeningports (ListeningPorts)
listeningports = s:option( Flag, "ListeningPorts" ) listeningports = s:option( Flag, "ListeningPorts", translate("Monitor all local listen ports") )
listeningports.default = 1 listeningports.default = 1
listeningports:depends( "enable", 1 ) listeningports:depends( "enable", 1 )
-- collectd_tcpconns.localports (LocalPort) -- collectd_tcpconns.localports (LocalPort)
localports = s:option( Value, "LocalPorts" ) localports = s:option( Value, "LocalPorts", translate("Monitor local ports") )
localports.optional = true localports.optional = true
localports:depends( "enable", 1 ) localports:depends( "enable", 1 )
-- collectd_tcpconns.remoteports (RemotePort) -- collectd_tcpconns.remoteports (RemotePort)
remoteports = s:option( Value, "RemotePorts" ) remoteports = s:option( Value, "RemotePorts", translate("Monitor remote ports") )
remoteports.optional = true remoteports.optional = true
remoteports:depends( "enable", 1 ) remoteports:depends( "enable", 1 )

View file

@ -13,13 +13,18 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") m = Map("luci_statistics",
translate("Unixsock Plugin Configuration"),
translate(
"The unixsock plugin creates a unix socket which can be used " ..
"to read collected data from a running collectd instance."
))
-- collectd_unixsock config section -- collectd_unixsock config section
s = m:section( NamedSection, "collectd_unixsock", "luci_statistics" ) s = m:section( NamedSection, "collectd_unixsock", "luci_statistics" )
-- collectd_unixsock.enable -- collectd_unixsock.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
-- collectd_unixsock.socketfile (SocketFile) -- collectd_unixsock.socketfile (SocketFile)

View file

@ -13,13 +13,18 @@ $Id$
]]-- ]]--
m = Map("luci_statistics") 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 -- collectd_wireless config section
s = m:section( NamedSection, "collectd_wireless", "luci_statistics" ) s = m:section( NamedSection, "collectd_wireless", "luci_statistics" )
-- collectd_wireless.enable -- collectd_wireless.enable
enable = s:option( Flag, "enable" ) enable = s:option( Flag, "enable", translate("Enable this plugin") )
enable.default = 0 enable.default = 0
return m return m