summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-unbound
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2018-09-18 12:17:19 +0200
committerAnsuel Smith <ansuelsmth@gmail.com>2018-09-18 17:31:25 +0200
commit013a8187ed565a98d2a8ace164708106c5e38a54 (patch)
tree29520316f3bf4533ba4e3ac952846b859d29d5de /applications/luci-app-unbound
parent2cbc3932e9dd8309560384631859199069f33e6f (diff)
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>
Diffstat (limited to 'applications/luci-app-unbound')
-rw-r--r--applications/luci-app-unbound/luasrc/controller/unbound.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/applications/luci-app-unbound/luasrc/controller/unbound.lua b/applications/luci-app-unbound/luasrc/controller/unbound.lua
index 771385b79..734476aca 100644
--- a/applications/luci-app-unbound/luasrc/controller/unbound.lua
+++ b/applications/luci-app-unbound/luasrc/controller/unbound.lua
@@ -52,6 +52,8 @@ function index()
entry({"admin", "services", "unbound", "status", "localzone"},
call("QueryLocalZone"), _("Local Zones"), 30).leaf = true
+ entry({"admin", "services", "unbound", "status", "dumpcache"},
+ call("QueryCacheDump"), _("Cache Dump"), 40).leaf = true
else
entry({"admin", "services", "unbound", "status", "statistics"},
call("ShowEmpty"), _("Statistics"), 10).leaf = true
@@ -151,6 +153,16 @@ function QueryLocalZone()
{heading = "", description = lcldesc, content = lcldata})
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()
local unboundfile = "/var/lib/unbound/unbound.conf"