summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/unbound
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-16 07:50:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-16 07:50:20 +0000
commitb26be28df9fd4db2106cc2a557966c9d2a7345d9 (patch)
tree437e6106c0aa2e73f2dd68d0551545ae503f60d7 /collectors/python.d.plugin/unbound
parentAdding upstream version 1.12.2. (diff)
downloadnetdata-b26be28df9fd4db2106cc2a557966c9d2a7345d9.tar.xz
netdata-b26be28df9fd4db2106cc2a557966c9d2a7345d9.zip
Adding upstream version 1.13.0.upstream/1.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/unbound')
-rw-r--r--collectors/python.d.plugin/unbound/README.md28
-rw-r--r--collectors/python.d.plugin/unbound/unbound.chart.py10
2 files changed, 34 insertions, 4 deletions
diff --git a/collectors/python.d.plugin/unbound/README.md b/collectors/python.d.plugin/unbound/README.md
index e213683ca..d9cbc0b8c 100644
--- a/collectors/python.d.plugin/unbound/README.md
+++ b/collectors/python.d.plugin/unbound/README.md
@@ -34,7 +34,7 @@ If extended stats are enabled, also provides:
* DNSCrypt Shared Secret Cache
* DNSCrypt Nonce Cache
-### configuration
+### Configuration
Unbound must be manually configured to enable the remote-control protocol.
Check the Unbound documentation for info on how to do this. Additionally,
@@ -73,6 +73,32 @@ local:
While it's a bit more complicated to set up correctly, it is recommended
that you use a UNIX socket as it provides far better performance.
+### Troubleshooting
+
+If you've configured the module and can't get it to work, make sure and
+check all of the following:
+
+* If you're using autodetection, double check that your `unbound.conf`
+ file is actually using spaces instead of tabs, and that appropriate
+ indentation is present. Most Linux distributions ship a default config
+ for Unbound that uses tabs, and the plugin can't read such a config file
+ correctly. Also, make sure this file is actually readable by Netdata.
+* Ensure that the control protocol is actually configured correctly.
+ You can check this quickly by running `unbound-control stats_noreset`
+ as root, which should print out a bunch of info about the internal
+ statistics of the server. If this returns an error, you don't have
+ the control protocol set up correctly.
+* If using the regular control interface, make sure that the certificate
+ and key file you have configured in `unbound.conf` are readable by
+ Netdata. In general, it's preferred to use ACL's on the files to
+ provide the required permissions.
+* If using a UNIX socket, make sure that the socket is both readable
+ _and_ writable by Netdata. Just like with the regular control
+ interface, it's preferred to use ACL's to provide these permissions.
+* Make sure that SELinux, Apparmor, or any other mandatory access control
+ system isn't interfering with the access requirements mentioned above.
+ In some cases, you may have to add a local rule to allow this access.
+
---
[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fpython.d.plugin%2Funbound%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()
diff --git a/collectors/python.d.plugin/unbound/unbound.chart.py b/collectors/python.d.plugin/unbound/unbound.chart.py
index adb58d417..dade2b204 100644
--- a/collectors/python.d.plugin/unbound/unbound.chart.py
+++ b/collectors/python.d.plugin/unbound/unbound.chart.py
@@ -9,7 +9,7 @@ import sys
from copy import deepcopy
from bases.FrameworkServices.SocketService import SocketService
-from bases.loaders import YamlOrderedLoader
+from bases.loaders import load_config
PRECISION = 1000
@@ -169,7 +169,7 @@ def _get_perthread_info(thread):
for key, value in PER_THREAD_STAT_MAP.items():
statmap[key.format(shortname=sname)] = (value[0].format(shortname=sname), value[1])
- return (charts, order, statmap)
+ return charts, order, statmap
class Service(SocketService):
@@ -205,7 +205,11 @@ class Service(SocketService):
def _auto_config(self):
if self.ubconf and os.access(self.ubconf, os.R_OK):
self.debug('Unbound config: {0}'.format(self.ubconf))
- conf = YamlOrderedLoader.load_config_from_file(self.ubconf)[0]
+ conf = dict()
+ try:
+ conf = load_config(self.ubconf)
+ except Exception as error:
+ self.error("error on loading '{0}' : {1}".format(self.ubconf, error))
if self.ext is None:
if 'extended-statistics' in conf['server']:
self.ext = conf['server']['extended-statistics']