Bugzilla – Bug 1181
Make changes in unbound-control syntax
Last modified: 2016-12-13 11:00:47 CET
1. unbound-control have to use data in /etc/default/unbound
I have unbound 1.5.8 installed on Ubuntu Server 16.4.
My unbound conf is not in default place (/opt/dns/unbound/etc/unbound/unbound.conf instead of /etc/unbound/unbound.conf)
I have created /etc/default/unbound:
But nevertheless, every time I run unbound-control, I have to point manually, where config file is:
/usr/bin/sudo /usr/sbin/unbound-control -c /opt/dns/unbound/etc/unbound/unbound.conf
It would be better, that if I omit "-c" parameter for unboud-control, it uses path for unbound.conf from /etc/default/unbound. It's for syntax of unbound-control to be simplier, light-weight.
2. unbound-control stats for only parameter.
Now, if I run statistics for unbound, it prints everything, and I have to use such heavy construction to get one parameter I need:
/usr/bin/sudo /usr/sbin/unbound-control -c /opt/dns/unbound/etc/unbound/unbound.conf stats | grep mem.cache.rrset | sed -e 's/^.*=//'
This construction is rather hard, when I need to obtain a lot of parameters for monitoring systems like Zabbix.
I think, it's better to change syntax for unbound-control stats, in sysctl style:
- if I run "unbound-control stats" with NO parameters, it prints everything
- if I run "unbound-control stats <parameter_name>" it prints only value of parameter I have written.
> I have created /etc/default/unbound:
> DAEMON_OPTS="-c /opt/dns/unbound/etc/unbound/unbound.conf"
This file works well, when I restart unbound service. Service managed knows, where unbound config placed.
I'd like unbound-control to have the same "knowledge" about config location
Regarding your first item: using values from /etc/default/unbound when starting the daemon is something done by your OS, not by Unbound itself. We can therefore not use values from this file in unbound-control.
Regarding your second item: thanks for this feature request. Sounds like a nice addition to me.
In addition to your second item: the unbound-munin plugin (in the contrib directory) gets all the statistics using "unbound-control stats" and writes the output to a temporary file. After that it uses grep to obtain the needed values from this file.
This way you only need to setup one connection using unbound-control.