summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-app-asterisk/Makefile1
-rw-r--r--applications/luci-app-dump1090/luasrc/model/cbi/dump1090.lua68
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua11
-rw-r--r--applications/luci-app-firewall/po/pl/firewall.po8
-rw-r--r--applications/luci-app-multiwan/po/es/multiwan.po2
-rw-r--r--applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua14
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/openvpn.lua56
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/sensors.lua125
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/i18n.lua30
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool.lua7
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua12
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua40
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua6
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua48
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua24
-rw-r--r--applications/luci-app-statistics/root/etc/config/luci_statistics3
-rwxr-xr-xapplications/luci-app-statistics/root/usr/bin/stat-genconfig16
17 files changed, 397 insertions, 74 deletions
diff --git a/applications/luci-app-asterisk/Makefile b/applications/luci-app-asterisk/Makefile
index f2f3cd1e7..3434e167f 100644
--- a/applications/luci-app-asterisk/Makefile
+++ b/applications/luci-app-asterisk/Makefile
@@ -7,7 +7,6 @@
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for Asterisk
-LUCI_DEPENDS:=+ahcpd
include ../../luci.mk
diff --git a/applications/luci-app-dump1090/luasrc/model/cbi/dump1090.lua b/applications/luci-app-dump1090/luasrc/model/cbi/dump1090.lua
index 6015ffe1f..8559c52b8 100644
--- a/applications/luci-app-dump1090/luasrc/model/cbi/dump1090.lua
+++ b/applications/luci-app-dump1090/luasrc/model/cbi/dump1090.lua
@@ -1,4 +1,4 @@
--- Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
+-- Copyright 2014-2015 Álvaro Fernández Rojas <noltari@gmail.com>
-- Licensed to the public under the Apache License 2.0.
m = Map("dump1090", "dump1090", translate("dump1090 is a Mode S decoder specifically designed for RTLSDR devices, here you can configure the settings."))
@@ -12,6 +12,7 @@ enable.enabled="0"
enable.disabled="1"
enable.default = "1"
enable.rmempty = false
+
respawn=s:option(Flag, "respawn", translate("Respawn"))
respawn.default = false
@@ -34,6 +35,15 @@ ifile=s:option(Value, "ifile", translate("Data file"))
ifile.rmempty = true
ifile.datatype = "file"
+iformat=s:option(ListValue, "iformat", translate("Sample format for data file"))
+iformat:value("", translate("Default"))
+iformat:value("UC8")
+iformat:value("SC16")
+iformat:value("SC16Q11")
+
+throttle=s:option(Flag, "throttle", translate("When reading from a file play back in realtime, not at max speed"))
+throttle.default = false
+
raw=s:option(Flag, "raw", translate("Show only messages hex values"))
raw.default = false
@@ -76,13 +86,17 @@ net_bo_port=s:option(Value, "net_bo_port", translate("TCP Beast output listen po
net_bo_port.rmempty = true
net_bo_port.datatype = "port"
+net_fatsv_port=s:option(Value, "net_fatsv_port", translate("FlightAware TSV output port"))
+net_fatsv_port.rmempty = true
+net_fatsv_port.datatype = "port"
+
net_ro_size=s:option(Value, "net_ro_size", translate("TCP raw output minimum size"))
net_ro_size.rmempty = true
net_ro_size.datatype = "uinteger"
-net_ro_rate=s:option(Value, "net_ro_rate", translate("TCP raw output memory flush rate"))
-net_ro_rate.rmempty = true
-net_ro_rate.datatype = "uinteger"
+net_ro_interval=s:option(Value, "net_ro_interval", translate("TCP raw output memory flush rate in seconds"))
+net_ro_interval.rmempty = true
+net_ro_interval.datatype = "uinteger"
net_heartbeat=s:option(Value, "net_heartbeat", translate("TCP heartbeat rate in seconds"))
net_heartbeat.rmempty = true
@@ -92,6 +106,12 @@ net_buffer=s:option(Value, "net_buffer", translate("TCP buffer size 64Kb * (2^n)
net_buffer.rmempty = true
net_buffer.datatype = "uinteger"
+net_verbatim=s:option(Flag, "net_verbatim", translate("Do not apply CRC corrections to messages we forward"))
+net_verbatim.default = false
+
+forward_mlat=s:option(Flag, "forward_mlat", translate("Allow forwarding of received mlat results to output ports"))
+forward_mlat.default = false
+
lat=s:option(Value, "lat", translate("Reference/receiver latitude for surface posn"))
lat.rmempty = true
lat.datatype = "integer"
@@ -100,6 +120,10 @@ lon=s:option(Value, "lon", translate("Reference/receiver longitude for surface p
lon.rmempty = true
lon.datatype = "integer"
+max_range=s:option(Value, "max_range", translate("Absolute maximum range for position decoding"))
+max_range.rmempty = true
+max_range.datatype = "uinteger"
+
fix=s:option(Flag, "fix", translate("Enable single-bits error correction using CRC"))
fix.default = false
@@ -121,6 +145,9 @@ mlat.default = false
stats=s:option(Flag, "stats", translate("Print stats at exit"))
stats.default = false
+stats_range=s:option(Flag, "stats_range", translate("Collect/show range histogram"))
+stats_range.default = false
+
stats_every=s:option(Value, "stats_every", translate("Show and reset stats every seconds"))
stats_every.rmempty = true
stats_every.datatype = "uinteger"
@@ -131,15 +158,42 @@ onlyaddr.default = false
metric=s:option(Flag, "metric", translate("Use metric units"))
metric.default = false
-snip=s:option(Flag, "snip", translate("Strip IQ file removing samples"))
+snip=s:option(Value, "snip", translate("Strip IQ file removing samples"))
snip.rmempty = true
snip.datatype = "uinteger"
-debug_mode=s:option(Flag, "debug", translate("Debug mode flags"))
+debug_mode=s:option(Value, "debug", translate("Debug mode flags"))
debug_mode.rmempty = true
-ppm=s:option(Flag, "ppm", translate("Set receiver error in parts per million"))
+ppm=s:option(Value, "ppm", translate("Set receiver error in parts per million"))
ppm.rmempty = true
ppm.datatype = "uinteger"
+html_dir=s:option(Value, "html_dir", translate("Base directory for the internal HTTP server"))
+html_dir.rmempty = true
+html_dir.datatype = "directory"
+
+write_json=s:option(Value, "write_json", translate("Periodically write json output to a directory"))
+write_json.rmempty = true
+write_json.datatype = "directory"
+
+write_json_every=s:option(Flag, "write_json_every", translate("Write json output every t seconds"))
+write_json_every.rmempty = true
+write_json_every.datatype = "uinteger"
+
+json_location_accuracy=s:option(ListValue, "json_location_accuracy", translate("Accuracy of receiver location in json metadata"))
+json_location_accuracy:value("", translate("Default"))
+json_location_accuracy:value("0", "No location")
+json_location_accuracy:value("1", "Approximate")
+json_location_accuracy:value("2", "Exact")
+
+oversample=s:option(Flag, "oversample", translate("Use the 2.4MHz demodulator"))
+oversample.default = false
+
+dcfilter=s:option(Flag, "dcfilter", translate("Apply a 1Hz DC filter to input data"))
+dcfilter.default = false
+
+measure_noise=s:option(Flag, "measure_noise", translate("Measure noise power"))
+measure_noise.default = false
+
return m
diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua
index 46b374440..6c90476f8 100644
--- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua
+++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/zone-details.lua
@@ -60,7 +60,7 @@ s:tab("advanced", translate("Advanced Settings"))
name = s:taboption("general", Value, "name", translate("Name"))
name.optional = false
name.forcewrite = true
-name.datatype = "uciname"
+name.datatype = "and(uciname,maxlength(14))"
function name.write(self, section, value)
if zone:name() ~= value then
@@ -76,15 +76,6 @@ function name.write(self, section, value)
}
end
-function name.validate(self, value)
- -- fw3 defines 14 as the maximum length of zone name
- if #value > 14 then
- return nil, translate("Zone name is too long")
- else
- return value
- end
-end
-
p = {
s:taboption("general", ListValue, "input", translate("Input")),
s:taboption("general", ListValue, "output", translate("Output")),
diff --git a/applications/luci-app-firewall/po/pl/firewall.po b/applications/luci-app-firewall/po/pl/firewall.po
index 18be74d23..2ccd25ccc 100644
--- a/applications/luci-app-firewall/po/pl/firewall.po
+++ b/applications/luci-app-firewall/po/pl/firewall.po
@@ -301,7 +301,7 @@ msgid "Restrict Masquerading to given destination subnets"
msgstr "Ogranicz maskaradę do wskazanych sieci docelowych"
msgid "Restrict Masquerading to given source subnets"
-msgstr "Ogranicz maskaradę do wskazanych sieci żródłowych"
+msgstr "Ogranicz maskaradę do wskazanych sieci źródłowych"
# Wstawiłem rodzinę gdyż gdzieś wcześniej było tak opisane ale klasa pasuje mi tu bardziej.
# Obsy - niestety ale "rodzina". W gui dotyczy to wyboru IPv4/IPv6, więc "rodzina" a nie klasa.
@@ -317,7 +317,7 @@ msgid ""
"Rewrite matched traffic to the given source port. May be left empty to only "
"rewrite the IP address."
msgstr ""
-"Przepisz dopasowany ruch do danego portu żródłowego. Można zostawić puste "
+"Przepisz dopasowany ruch do danego portu źródłowego. Można zostawić puste "
"aby przepisać tylko adres IP"
msgid "Rewrite to source %s"
@@ -339,7 +339,7 @@ msgid "Source MAC address"
msgstr "Źródłowy adres MAC"
msgid "Source NAT"
-msgstr "NAT żródłowy"
+msgstr "NAT źródłowy"
# http://www.digipedia.pl/def/doc/id/677604507/name/SNAT/
msgid ""
@@ -348,7 +348,7 @@ msgid ""
"multiple WAN addresses to internal subnets."
msgstr ""
"SNAT używany jest wtedy, gdy zmieniane są adresy pakietów połączenia "
-"wychodzącego, czyli pakiety żródłowe. Wykonywany jest zawsze po routowaniu "
+"wychodzącego, czyli pakiety źródłowe. Wykonywany jest zawsze po routowaniu "
"(POSTROUTING), a więc w chwili, gdy pakiety są gotowe opuścić host. "
"IPmasquerading jest formą SNAT."
diff --git a/applications/luci-app-multiwan/po/es/multiwan.po b/applications/luci-app-multiwan/po/es/multiwan.po
index 1a54f7557..4d2447eec 100644
--- a/applications/luci-app-multiwan/po/es/multiwan.po
+++ b/applications/luci-app-multiwan/po/es/multiwan.po
@@ -118,7 +118,7 @@ msgid "WAN Interfaces"
msgstr "Interfaces WAN"
msgid "WAN Uplink"
-msgstr "Enalce saliente WAN"
+msgstr "Enlace saliente WAN"
msgid "all"
msgstr "todos"
diff --git a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
index 49eab5acd..3f26aeed6 100644
--- a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
+++ b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
@@ -20,7 +20,7 @@ function index()
local labels = {
s_output = _("Output plugins"),
- s_system = _("System plugins"),
+ s_general = _("General plugins"),
s_network = _("Network plugins"),
conntrack = _("Conntrack"),
@@ -42,9 +42,11 @@ function index()
network = _("Network"),
nut = _("UPS"),
olsrd = _("OLSRd"),
+ openvpn = _("OpenVPN"),
ping = _("Ping"),
processes = _("Processes"),
rrdtool = _("RRDTool"),
+ sensors = _("Sensors"),
splash_leases = _("Splash Leases"),
tcpconns = _("TCP Connections"),
unixsock = _("UnixSock"),
@@ -54,15 +56,15 @@ function index()
-- our collectd menu
local collectd_menu = {
output = { "csv", "network", "rrdtool", "unixsock" },
- system = { "cpu", "df", "disk", "email", "entropy", "exec", "irq", "load", "memory", "nut", "processes", "uptime" },
- network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "ping", "splash_leases", "tcpconns", "iwinfo" }
+ general = { "cpu", "df", "disk", "email", "entropy", "exec", "irq", "load", "memory", "nut", "processes", "sensors", "uptime" },
+ network = { "conntrack", "dns", "interface", "iptables", "netlink", "olsrd", "openvpn", "ping", "splash_leases", "tcpconns", "iwinfo" }
}
-- create toplevel menu nodes
local st = entry({"admin", "statistics"}, template("admin_statistics/index"), _("Statistics"), 80)
st.index = true
- entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("Collectd"), 10).subindex = true
+ entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _("Setup"), 20).subindex = true
-- populate collectd plugin menu
@@ -87,7 +89,7 @@ function index()
end
-- output views
- local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"), 80)
+ local page = entry( { "admin", "statistics", "graph" }, template("admin_statistics/index"), _("Graphs"), 10)
page.setuser = "nobody"
page.setgroup = "nogroup"
@@ -170,7 +172,7 @@ function statistics_render()
if #instances == 0 then
--instances = { graph.tree:plugin_instances( plugin )[1] }
instances = graph.tree:plugin_instances( plugin )
- is_index = true
+ is_index = (#instances > 1)
-- index instance requested
elseif instances[1] == "-" then
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/openvpn.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/openvpn.lua
new file mode 100644
index 000000000..193f0448a
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/openvpn.lua
@@ -0,0 +1,56 @@
+-- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
+
+require "luci.sys"
+
+local m, s, o
+
+
+m = Map("luci_statistics",
+ translate("OpenVPN Plugin Configuration"),
+ translate("The OpenVPN plugin gathers information about the current vpn connection status."))
+
+s = m:section( NamedSection, "collectd_openvpn", "luci_statistics" )
+
+
+o = s:option( Flag, "enable", translate("Enable this plugin") )
+o.default = "0"
+
+
+o = s:option(Flag, "CollectIndividualUsers", translate("Generate a separate graph for each logged user"))
+o.default = "0"
+o.rmempty = true
+o:depends("enable", 1)
+
+
+o = s:option(Flag, "CollectUserCount", translate("Aggregate number of connected users"))
+o.default = "0"
+o.rmempty = true
+o:depends("enable", 1)
+
+
+o = s:option(Flag, "CollectCompression", translate("Gather compression statistics"))
+o.default = "0"
+o.rmempty = true
+o:depends("enable", 1)
+
+
+o = s:option(Flag, "ImprovedNamingSchema", translate("Use improved naming schema"))
+o.default = "0"
+o.rmempty = true
+o:depends("enable", 1)
+
+
+o = s:option(DynamicList, "StatusFile", translate("OpenVPN status files"))
+o.rmempty = true
+o:depends("enable", 1)
+
+local status_files = nixio.fs.glob("/var/run/openvpn.*.status")
+if status_files then
+ local status_file
+ for status_file in status_files do
+ o:value(status_file)
+ end
+end
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/sensors.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/sensors.lua
new file mode 100644
index 000000000..77e36bfaf
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/sensors.lua
@@ -0,0 +1,125 @@
+-- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
+
+require "luci.sys"
+
+local m, s, o
+local sensor_types = {
+ ["12v"] = "voltage",
+ ["2.0v"] = "voltage",
+ ["2.5v"] = "voltage",
+ ["3.3v"] = "voltage",
+ ["5.0v"] = "voltage",
+ ["5v"] = "voltage",
+ ["ain1"] = "voltage",
+ ["ain2"] = "voltage",
+ ["cpu_temp"] = "temperature",
+ ["fan1"] = "fanspeed",
+ ["fan2"] = "fanspeed",
+ ["fan3"] = "fanspeed",
+ ["fan4"] = "fanspeed",
+ ["fan5"] = "fanspeed",
+ ["fan6"] = "fanspeed",
+ ["fan7"] = "fanspeed",
+ ["in0"] = "voltage",
+ ["in10"] = "voltage",
+ ["in2"] = "voltage",
+ ["in3"] = "voltage",
+ ["in4"] = "voltage",
+ ["in5"] = "voltage",
+ ["in6"] = "voltage",
+ ["in7"] = "voltage",
+ ["in8"] = "voltage",
+ ["in9"] = "voltage",
+ ["power1"] = "power",
+ ["remote_temp"] = "temperature",
+ ["temp1"] = "temperature",
+ ["temp2"] = "temperature",
+ ["temp3"] = "temperature",
+ ["temp4"] = "temperature",
+ ["temp5"] = "temperature",
+ ["temp6"] = "temperature",
+ ["temp7"] = "temperature",
+ ["temp"] = "temperature",
+ ["vccp1"] = "voltage",
+ ["vccp2"] = "voltage",
+ ["vdd"] = "voltage",
+ ["vid1"] = "voltage",
+ ["vid2"] = "voltage",
+ ["vid3"] = "voltage",
+ ["vid4"] = "voltage",
+ ["vid5"] = "voltage",
+ ["vid"] = "voltage",
+ ["vin1"] = "voltage",
+ ["vin2"] = "voltage",
+ ["vin3"] = "voltage",
+ ["vin4"] = "voltage",
+ ["volt12"] = "voltage",
+ ["volt5"] = "voltage",
+ ["voltbatt"] = "voltage",
+ ["vrm"] = "voltage"
+
+}
+
+
+m = Map("luci_statistics",
+ translate("Sensors Plugin Configuration"),
+ translate("The sensors plugin uses the Linux Sensors framework to gather environmental statistics."))
+
+s = m:section( NamedSection, "collectd_sensors", "luci_statistics" )
+
+
+o = s:option( Flag, "enable", translate("Enable this plugin") )
+o.default = 0
+
+
+o = s:option(Flag, "__all", translate("Monitor all sensors"))
+o:depends("enable", 1)
+o.default = 1
+o.write = function() end
+o.cfgvalue = function(self, sid)
+ local v = self.map:get(sid, "Sensor")
+ if v == nil or (type(v) == "table" and #v == 0) or (type(v) == "string" and #v == 0) then
+ return "1"
+ end
+end
+
+
+o = s:option(MultiValue, "Sensor", translate("Sensor list"), translate("Hold Ctrl to select multiple items or to deselect entries."))
+o:depends({enable = 1, __all = "" })
+o.widget = "select"
+o.rmempty = true
+o.size = 0
+
+local sensorcli = io.popen("/usr/sbin/sensors -u -A")
+if sensorcli then
+ local bus, sensor
+
+ while true do
+ local ln = sensorcli:read("*ln")
+ if not ln then
+ break
+ elseif ln:match("^[%w-]+$") then
+ bus = ln
+ elseif ln:match("^[%w-]+:$") then
+ sensor = ln:sub(0, -2):lower()
+ if bus and sensor_types[sensor] then
+ o:value("%s/%s-%s" %{ bus, sensor_types[sensor], sensor })
+ o.size = o.size + 1
+ end
+ elseif ln == "" then
+ bus = nil
+ sensor = nil
+ end
+ end
+
+ sensorcli:close()
+end
+
+
+o = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
+o.default = 0
+o.rmempty = true
+o:depends({ enable = 1, __all = "" })
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/statistics/i18n.lua b/applications/luci-app-statistics/luasrc/statistics/i18n.lua
index 5a2800d5f..7877e61ab 100644
--- a/applications/luci-app-statistics/luasrc/statistics/i18n.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/i18n.lua
@@ -26,15 +26,6 @@ function Instance._subst( self, str, val )
return str
end
-function Instance._translate( self, key, alt )
- local val = self.i18n.string(key)
- if val ~= key then
- return val
- else
- return alt
- end
-end
-
function Instance.title( self, plugin, pinst, dtype, dinst, user_title )
local title = user_title or
@@ -73,24 +64,17 @@ end
function Instance.ds( self, source )
- local label = source.title or self:_translate(
- string.format( "stat_ds_%s_%s_%s", source.type, source.instance, source.ds ),
- self:_translate(
- string.format( "stat_ds_%s_%s", source.type, source.instance ),
- self:_translate(
- string.format( "stat_ds_label_%s__%s", source.type, source.ds ),
- self:_translate(
- string.format( "stat_ds_%s", source.type ),
- source.type .. "_" .. source.instance:gsub("[^%w]","_") .. "_" .. source.ds
- )
- )
- )
- )
+ local label = source.title or
+ "dt=%s/di=%s/ds=%s" % {
+ (source.type and #source.type > 0) and source.type or "(nil)",
+ (source.instance and #source.instance > 0) and source.instance or "(nil)",
+ (source.ds and #source.ds > 0) and source.ds or "(nil)"
+ }
return self:_subst( label, {
dtype = source.type,
dinst = source.instance,
dsrc = source.ds
- } )
+ } ):gsub(":", "\\:")
end
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
index d8317a817..5d4ad9859 100644
--- a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
@@ -397,6 +397,7 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index )
transform_rpn = dopts.transform_rpn or "0,+",
noarea = dopts.noarea or false,
title = dopts.title or nil,
+ weight = dopts.weight or nil,
ds = dsource,
type = dtype,
instance = dinst,
@@ -469,6 +470,12 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index )
for i, o in ipairs(opts.rrdopts) do _ti( _args, o ) end
end
+ -- sort sources
+ table.sort(_sources, function(a, b)
+ local x = a.weight or a.index or 0
+ local y = b.weight or b.index or 0
+ return x < y
+ end)
-- create DEF statements for each instance
for i, source in ipairs(_sources) do
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua
index efa631d55..6f687d218 100644
--- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua
@@ -66,36 +66,40 @@ function rrdargs( graph, plugin, plugin_instance )
options = {
-- processed packets (tx DS)
if_packets__tx = {
+ weight = 1,
overlay = true, -- don't summarize
total = true, -- report total amount of bytes
color = "00ff00", -- processed tx is green
- title = "Processed (tx)"
+ title = "Processed (TX)"
},
-- processed packets (rx DS)
if_packets__rx = {
+ weight = 2,
overlay = true, -- don't summarize
flip = true, -- flip rx line
total = true, -- report total amount of bytes
color = "0000ff", -- processed rx is blue
- title = "Processed (rx)"
+ title = "Processed (RX)"
},
-- packet errors (tx DS)
if_errors__tx = {
+ weight = 0,
overlay = true, -- don't summarize
total = true, -- report total amount of packets
color = "ff5500", -- tx errors are orange
- title = "Errors (tx)"
+ title = "Errors (TX)"
},
-- packet errors (rx DS)
if_errors__rx = {
+ weight = 3,
overlay = true, -- don't summarize
flip = true, -- flip rx line
total = true, -- report total amount of packets
color = "ff0000", -- rx errors are red
- title = "Errors (rx)"
+ title = "Errors (RX)"
}
}
}
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua
index b4f2ac185..7b6acf366 100644
--- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua
@@ -22,11 +22,13 @@ function rrdargs( graph, plugin, plugin_instance )
-- special options for single data lines
options = {
if_octets__tx = {
+ title = "Bytes (TX)",
total = true, -- report total amount of bytes
color = "00ff00" -- tx is green
},
if_octets__rx = {
+ title = "Bytes (RX)",
flip = true, -- flip rx line
total = true, -- report total amount of bytes
color = "0000ff" -- rx is blue
@@ -59,6 +61,8 @@ function rrdargs( graph, plugin, plugin_instance )
options = {
-- processed packets (tx DS)
if_packets__tx = {
+ weight = 2,
+ title = "Total (TX)",
overlay = true, -- don't summarize
total = true, -- report total amount of bytes
color = "00ff00" -- processed tx is green
@@ -66,6 +70,8 @@ function rrdargs( graph, plugin, plugin_instance )
-- processed packets (rx DS)
if_packets__rx = {
+ weight = 3,
+ title = "Total (RX)",
overlay = true, -- don't summarize
flip = true, -- flip rx line
total = true, -- report total amount of bytes
@@ -74,6 +80,8 @@ function rrdargs( graph, plugin, plugin_instance )
-- dropped packets (tx DS)
if_dropped__tx = {
+ weight = 1,
+ title = "Dropped (TX)",
overlay = true, -- don't summarize
total = true, -- report total amount of bytes
color = "660055" -- dropped tx is ... dunno ;)
@@ -81,14 +89,18 @@ function rrdargs( graph, plugin, plugin_instance )
-- dropped packets (rx DS)
if_dropped__rx = {
+ weight = 4,
+ title = "Dropped (RX)",
overlay = true, -- don't summarize
flip = true, -- flip rx line
total = true, -- report total amount of bytes
- color = "440066" -- dropped rx is violett
+ color = "ff00ff" -- dropped rx is violett
},
-- packet errors (tx DS)
if_errors__tx = {
+ weight = 0,
+ title = "Errors (TX)",
overlay = true, -- don't summarize
total = true, -- report total amount of packets
color = "ff5500" -- tx errors are orange
@@ -96,6 +108,8 @@ function rrdargs( graph, plugin, plugin_instance )
-- packet errors (rx DS)
if_errors__rx = {
+ weight = 5,
+ title = "Errors (RX)",
overlay = true, -- don't summarize
flip = true, -- flip rx line
total = true, -- report total amount of packets
@@ -122,6 +136,7 @@ function rrdargs( graph, plugin, plugin_instance )
options = {
-- multicast packets
if_multicast = {
+ title = "Packets",
total = true, -- report total amount of packets
color = "0000ff" -- multicast is blue
}
@@ -146,6 +161,7 @@ function rrdargs( graph, plugin, plugin_instance )
options = {
-- collision rate
if_collisions = {
+ title = "Collisions",
total = true, -- report total amount of packets
color = "ff0000" -- collsions are red
}
@@ -173,15 +189,19 @@ function rrdargs( graph, plugin, plugin_instance )
},
-- special options for single data lines
- options = { -- XXX: fixme (define colors...)
- if_tx_errors = {
- total = true
- },
-
- if_rx_errors = {
- flip = true,
- total = true
- }
+ options = {
+ if_tx_errors_aborted_value = { total = true, color = "ffff00", title = "Aborted (TX)" },
+ if_tx_errors_carrier_value = { total = true, color = "ffcc00", title = "Carrier (TX)" },
+ if_tx_errors_fifo_value = { total = true, color = "ff9900", title = "Fifo (TX)" },
+ if_tx_errors_heartbeat_value = { total = true, color = "ff6600", title = "Heartbeat (TX)" },
+ if_tx_errors_window_value = { total = true, color = "ff3300", title = "Window (TX)" },
+
+ if_rx_errors_length_value = { flip = true, total = true, color = "ff0000", title = "Length (RX)" },
+ if_rx_errors_missed_value = { flip = true, total = true, color = "ff0033", title = "Missed (RX)" },
+ if_rx_errors_over_value = { flip = true, total = true, color = "ff0066", title = "Over (RX)" },
+ if_rx_errors_crc_value = { flip = true, total = true, color = "ff0099", title = "CRC (RX)" },
+ if_rx_errors_fifo_value = { flip = true, total = true, color = "ff00cc", title = "Fifo (RX)" },
+ if_rx_errors_frame_value = { flip = true, total = true, color = "ff00ff", title = "Frame (RX)" }
}
}
}
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua
index 6dc81bc1d..8b04ab8b3 100644
--- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua
@@ -44,9 +44,6 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
y_max = "100",
number_format = "%5.1lf%%",
data = {
- sources = {
- percent = { "percent" }
- },
instances = {
percent = "charge"
},
@@ -77,9 +74,6 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
vlabel = "Minutes",
number_format = "%.1lfm",
data = {
- sources = {
- timeleft = { "timeleft" }
- },
instances = {
timeleft = { "battery" }
},
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua
new file mode 100644
index 000000000..876e871d1
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua
@@ -0,0 +1,48 @@
+-- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
+
+module("luci.statistics.rrdtool.definitions.openvpn", package.seeall)
+
+function rrdargs( graph, plugin, plugin_instance )
+ local inst = plugin_instance:gsub("^openvpn%.(.+)%.status$", "%1")
+
+ return {
+ {
+ title = "%%H: OpenVPN \"%s\" - Traffic" % inst,
+ vlabel = "Bytes/s",
+ data = {
+ instances = {
+ if_octets = { "traffic", "overhead" }
+ },
+ sources = {
+ if_octets = { "tx", "rx" }
+ },
+ options = {
+ if_octets_traffic_tx = { weight = 0, title = "Bytes (TX)", total = true, color = "00ff00" },
+ if_octets_overhead_tx = { weight = 1, title = "Overhead (TX)", total = true, color = "ff9900" },
+ if_octets_overhead_rx = { weight = 2, title = "Overhead (RX)", total = true, flip = true, color = "ff00ff" },
+ if_octets_traffic_rx = { weight = 3, title = "Bytes (RX)", total = true, flip = true, color = "0000ff" }
+ }
+ }
+ },
+
+ {
+ title = "%%H: OpenVPN \"%s\" - Compression" % inst,
+ vlabel = "Bytes/s",
+ data = {
+ instances = {
+ compression = { "data_out", "data_in" }
+ },
+ sources = {
+ compression = { "uncompressed", "compressed" }
+ },
+ options = {
+ compression_data_out_uncompressed = { weight = 0, title = "Uncompressed (TX)", total = true, color = "00ff00" },
+ compression_data_out_compressed = { weight = 1, title = "Compressed (TX)", total = true, color = "008800" },
+ compression_data_in_compressed = { weight = 2, title = "Compressed (RX)", total = true, flip = true, color = "000088" },
+ compression_data_in_uncompressed = { weight = 3, title = "Uncompressed (RX)", total = true, flip = true, color = "0000ff" }
+ }
+ }
+ }
+ }
+end
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua
new file mode 100644
index 000000000..f8bddb96e
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua
@@ -0,0 +1,24 @@
+-- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
+
+module("luci.statistics.rrdtool.definitions.sensors", package.seeall)
+
+function rrdargs( graph, plugin, plugin_instance )
+ return {
+ {
+ per_instance = true,
+ title = "%H: %pi - %di",
+ vlabel = "\176C",
+ number_format = "%4.1lf\176C",
+ data = {
+ types = { "temperature" },
+ options = {
+ temperature__value = {
+ color = "ff0000",
+ title = "Temperature"
+ }
+ }
+ }
+ }
+ }
+end
diff --git a/applications/luci-app-statistics/root/etc/config/luci_statistics b/applications/luci-app-statistics/root/etc/config/luci_statistics
index abcee3e93..de16f29de 100644
--- a/applications/luci-app-statistics/root/etc/config/luci_statistics
+++ b/applications/luci-app-statistics/root/etc/config/luci_statistics
@@ -140,6 +140,9 @@ config statistics 'collectd_processes'
option enable '0'
option Processes 'uhttpd dnsmasq dropbear'
+config statistics 'collectd_sensors'
+ option enable '0'
+
config statistics 'collectd_splash_leases'
option enable '0'
diff --git a/applications/luci-app-statistics/root/usr/bin/stat-genconfig b/applications/luci-app-statistics/root/usr/bin/stat-genconfig
index 8acae46c6..49d8a0993 100755
--- a/applications/luci-app-statistics/root/usr/bin/stat-genconfig
+++ b/applications/luci-app-statistics/root/usr/bin/stat-genconfig
@@ -187,9 +187,9 @@ function _list_expand( c, l, nopad )
end
if n:find("(%w+)ses") then
- k = n:gsub("(%w+)ses", "%1s")
+ k = n:gsub("(%w+)ses$", "%1s")
else
- k = n:gsub("(%w+)s", "%1")
+ k = n:gsub("(%w+)s$", "%1")
end
str = str .. _expand( c[n], k, nopad )
@@ -375,6 +375,12 @@ plugins = {
{ }
},
+ openvpn = {
+ { },
+ { "CollectIndividualUsers", "CollectUserCount", "CollectCompression", "ImprovedNamingSchema" },
+ { "StatusFile" }
+ },
+
ping = {
{ "TTL", "Interval" },
{ },
@@ -393,6 +399,12 @@ plugins = {
{ "RRATimespans" }
},
+ sensors = {
+ { },
+ { "IgnoreSelected" },
+ { "Sensor" }
+ },
+
splash_leases = {
{ },
{ },