diff options
author | Christian Schoenebeck <christian.schoenebeck@gmail.com> | 2015-08-28 11:19:00 +0200 |
---|---|---|
committer | Christian Schoenebeck <christian.schoenebeck@gmail.com> | 2015-08-28 11:19:00 +0200 |
commit | 89763f901e5f3c27b0ab998e5332f21d04f8e25f (patch) | |
tree | a0be874edeb594b2346bbbfdb855a93821a9d8d4 | |
parent | 084d435060f73a8e098c8022a43bd9f5b1fd63ca (diff) | |
parent | 7df0df48c006bbe3a8f4f73cd7b0bdc9bec0f80e (diff) |
Merge pull request #452 from hnyman/entropy
statistics: Add support for entropy stats
5 files changed, 44 insertions, 1 deletions
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 c532b4a6d..49eab5acd 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 @@ -30,6 +30,7 @@ function index() disk = _("Disk Usage"), dns = _("DNS"), email = _("Email"), + entropy = _("Entropy"), exec = _("Exec"), interface = _("Interfaces"), iptables = _("Firewall"), @@ -53,7 +54,7 @@ function index() -- our collectd menu local collectd_menu = { output = { "csv", "network", "rrdtool", "unixsock" }, - system = { "cpu", "df", "disk", "email", "exec", "irq", "load", "memory", "nut", "processes", "uptime" }, + 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" } } diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/entropy.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/entropy.lua new file mode 100644 index 000000000..d18bf910f --- /dev/null +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/entropy.lua @@ -0,0 +1,14 @@ +-- Copyright 2015 Hannu Nyman <hannu.nyman@iki.fi> +-- Licensed to the public under the Apache License 2.0. + +m = Map("luci_statistics", + translate("Entropy Plugin Configuration"), + translate("The entropy plugin collects statistics about the available entropy.")) + +s = m:section( NamedSection, "collectd_entropy", "luci_statistics" ) + +enable = s:option( Flag, "enable", translate("Enable this plugin") ) +enable.default = 0 + +return m + diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/entropy.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/entropy.lua new file mode 100644 index 000000000..3d30a70af --- /dev/null +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/entropy.lua @@ -0,0 +1,19 @@ +-- Copyright 2015 Hannu Nyman <hannu.nyman@iki.fi> +-- Licensed to the public under the Apache License 2.0. + +module("luci.statistics.rrdtool.definitions.entropy", package.seeall) + +function rrdargs( graph, plugin, plugin_instance, dtype ) + + return { + title = "%H: Available entropy", + vlabel = "bits", + number_format = "%4.0lf", + data = { + types = { "entropy" }, + options = { entropy = { title = "Entropy %di" } } + } + } + +end + diff --git a/applications/luci-app-statistics/root/etc/config/luci_statistics b/applications/luci-app-statistics/root/etc/config/luci_statistics index e39db3513..b91b20f95 100644 --- a/applications/luci-app-statistics/root/etc/config/luci_statistics +++ b/applications/luci-app-statistics/root/etc/config/luci_statistics @@ -45,6 +45,9 @@ config 'statistics' 'collectd_email' option 'SocketFile' '/var/run/collectd/email.sock' option 'SocketGroup' 'nogroup' +config 'statistics' 'collectd_entropy' + option 'enable' '0' + config 'statistics' 'collectd_exec' 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 cb94e2811..8acae46c6 100755 --- a/applications/luci-app-statistics/root/usr/bin/stat-genconfig +++ b/applications/luci-app-statistics/root/usr/bin/stat-genconfig @@ -303,6 +303,12 @@ plugins = { { } }, + entropy = { + { }, + { }, + { } + }, + exec = config_exec, interface = { |