summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions')
-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
5 files changed, 110 insertions, 20 deletions
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 efa631d557..6f687d218d 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 b4f2ac185e..7b6acf3663 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 6dc81bc1d7..8b04ab8b38 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 0000000000..876e871d1d
--- /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 0000000000..f8bddb96e3
--- /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