Merge pull request #2844 from TDT-AG/pr/20190709-luci-app-statistics

luci-app-statistics: fix collectd config generation
This commit is contained in:
Florian Eckert 2019-07-09 13:59:24 +02:00 committed by GitHub
commit 9f1757a8af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,15 +276,11 @@ plugins = {
{ },
{ }
},
curl = config_curl,
exec = config_exec,
iptables = config_iptables,
logfile = {
{ "LogLevel", "File" },
{ "Timestamp" },
{ }
},
network = config_network,
}
local plugin_dir = "/usr/lib/lua/luci/statistics/plugins/"
@ -293,8 +289,18 @@ for filename in nixio.fs.dir(plugin_dir) do
setfenv(plugin_fun, { _ = luci.i18n.translate })
local plugin = plugin_fun()
local name = filename:gsub("%.lua", "")
if (name == "exec") then
plugins[name] = config_exec
elseif (name == "iptables") then
plugins[name] = config_iptables
elseif (name == "curl") then
plugins[name] = config_curl
elseif (name == "network") then
plugins[name] = config_network
else
plugins[name] = plugin.legend
end
end
preprocess = {