summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/statistics
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-10-05 18:55:28 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-10-05 18:55:28 +0200
commit3289e134953887482bdaa28c28567917bb91facb (patch)
tree09d24627791b6cde12a4c49fb64ab04da7186302 /applications/luci-app-statistics/luasrc/statistics
parentcff2b99b4f9af0957ff6de4fe1ce48d30337b41b (diff)
luci-app-statistics: add initial support for collectd-mod-openvpn
This changeset covers compression and traffic stats, not every combination has been tested yet. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'applications/luci-app-statistics/luasrc/statistics')
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua48
1 files changed, 48 insertions, 0 deletions
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..50efddbc2
--- /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 = { title = "Bytes (TX)", total = true, color = "00ff00" },
+ if_octets_overhead_tx = { title = "Overhead (TX)", total = true, color = "ff9900" },
+ if_octets_traffic_rx = { title = "Bytes (RX)", total = true, flip = true, color = "0000ff" },
+ if_octets_overhead_rx = { title = "Overhead (RX)", total = true, flip = true, color = "ff00ff" }
+ }
+ }
+ },
+
+ {
+ title = "%%H: OpenVPN \"%s\" - Compression" % inst,
+ vlabel = "Bytes/s",
+ data = {
+ instances = {
+ compression = { "data_out", "data_in" }
+ },
+ sources = {
+ compression = { "uncompressed", "compressed" }
+ },
+ options = {
+ compression_data_out_compressed = { title = "Compressed (TX)", total = true, color = "008800" },
+ compression_data_out_uncompressed = { title = "Uncompressed (TX)", total = true, color = "00ff00" },
+ compression_data_in_compressed = { title = "Compressed (RX)", total = true, flip = true, color = "000088" },
+ compression_data_in_uncompressed = { title = "Uncompressed (RX)", total = true, flip = true, color = "0000ff" }
+ }
+ }
+ }
+ }
+end