local sections = uci:get_all( "luci_statistics" )
+function print(...)
+ nixio.stdout:write(...)
+ nixio.stdout:write("\n")
+end
+
function section( plugin )
local config = sections[ "collectd_" .. plugin ] or sections["collectd"]
if host then
if port then
- str = str .. "\t" .. key .. " " .. host .. " " .. port .. "\n"
+ str = str .. "\t" .. key .. " \"" .. host .. "\" \"" .. port .. "\"\n"
else
- str = str .. "\t" .. key .. " " .. host .. "\n"
+ str = str .. "\t" .. key .. " \"" .. host .. "\"\n"
end
end
end
end
return str
+
+ elseif type(s) == "table" then
+ local str = ""
+
+ for i, v in ipairs(s) do
+ str = str .. _string( v, n, nopad )
+ end
end
end
if not nopad then pad = "\t" end
if s then
- if s:find("[^%d]") then
- if not s:find("[^%w]") then
+ if s:find("[^%d]") or n == "Port" then
+ if not s:find("[^%w]") and n ~= "Port" then
str = pad .. n .. " " .. luci.util.trim(s)
else
str = pad .. n .. ' "' .. luci.util.trim(s) .. '"'
{ }
},
+ conntrack = {
+ { },
+ { },
+ { }
+ },
+
cpu = {
{ },
{ },
{ "Irqs" }
},
+ iwinfo = {
+ { },
+ { "IgnoreSelected" },
+ { "Interfaces" }
+ },
+
load = {
{ },
{ },
{ }
},
+ madwifi = {
+ { "WatchSet" },
+ { },
+ { "Interfaces", "WatchAdds" }
+ },
+
+ memory = {
+ { },
+ { },
+ { }
+ },
+
netlink = {
{ },
{ "IgnoreSelected" },
network = config_network,
+ olsrd = {
+ { "Host", "Port", "CollectLinks","CollectRoutes","CollectTopology"},
+ { },
+ { }
+ },
+
ping = {
- { "TTL" },
+ { "TTL", "Interval" },
{ },
{ "Hosts" }
},