luci-app-unbound: add cache_dump tab
This adds in the State tab a new option to dump cache from unbound-control application Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
This commit is contained in:
parent
2cbc3932e9
commit
013a8187ed
1 changed files with 12 additions and 0 deletions
|
@ -52,6 +52,8 @@ function index()
|
||||||
entry({"admin", "services", "unbound", "status", "localzone"},
|
entry({"admin", "services", "unbound", "status", "localzone"},
|
||||||
call("QueryLocalZone"), _("Local Zones"), 30).leaf = true
|
call("QueryLocalZone"), _("Local Zones"), 30).leaf = true
|
||||||
|
|
||||||
|
entry({"admin", "services", "unbound", "status", "dumpcache"},
|
||||||
|
call("QueryCacheDump"), _("Cache Dump"), 40).leaf = true
|
||||||
else
|
else
|
||||||
entry({"admin", "services", "unbound", "status", "statistics"},
|
entry({"admin", "services", "unbound", "status", "statistics"},
|
||||||
call("ShowEmpty"), _("Statistics"), 10).leaf = true
|
call("ShowEmpty"), _("Statistics"), 10).leaf = true
|
||||||
|
@ -151,6 +153,16 @@ function QueryLocalZone()
|
||||||
{heading = "", description = lcldesc, content = lcldata})
|
{heading = "", description = lcldesc, content = lcldata})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function QueryCacheDump()
|
||||||
|
local lcldata = luci.util.exec(
|
||||||
|
"unbound-control -c /var/lib/unbound/unbound.conf dump_cache")
|
||||||
|
|
||||||
|
local lcldesc = luci.i18n.translate(
|
||||||
|
"This shows Unbound 'cache_dump'. Usefull to check if unbound is actually caching dns entities.")
|
||||||
|
|
||||||
|
luci.template.render("unbound/show-textbox",
|
||||||
|
{heading = "", description = lcldesc, content = lcldata})
|
||||||
|
end
|
||||||
|
|
||||||
function ShowUnboundConf()
|
function ShowUnboundConf()
|
||||||
local unboundfile = "/var/lib/unbound/unbound.conf"
|
local unboundfile = "/var/lib/unbound/unbound.conf"
|
||||||
|
|
Loading…
Reference in a new issue