summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/nsd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/python.d.plugin/nsd/Makefile.inc13
-rw-r--r--collectors/python.d.plugin/nsd/README.md54
-rw-r--r--collectors/python.d.plugin/nsd/nsd.chart.py (renamed from python.d/nsd.chart.py)45
-rw-r--r--collectors/python.d.plugin/nsd/nsd.conf (renamed from conf.d/python.d/nsd.conf)0
4 files changed, 93 insertions, 19 deletions
diff --git a/collectors/python.d.plugin/nsd/Makefile.inc b/collectors/python.d.plugin/nsd/Makefile.inc
new file mode 100644
index 000000000..58e9fd67d
--- /dev/null
+++ b/collectors/python.d.plugin/nsd/Makefile.inc
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# THIS IS NOT A COMPLETE Makefile
+# IT IS INCLUDED BY ITS PARENT'S Makefile.am
+# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
+
+# install these files
+dist_python_DATA += nsd/nsd.chart.py
+dist_pythonconfig_DATA += nsd/nsd.conf
+
+# do not install these files, but include them in the distribution
+dist_noinst_DATA += nsd/README.md nsd/Makefile.inc
+
diff --git a/collectors/python.d.plugin/nsd/README.md b/collectors/python.d.plugin/nsd/README.md
new file mode 100644
index 000000000..02c302f41
--- /dev/null
+++ b/collectors/python.d.plugin/nsd/README.md
@@ -0,0 +1,54 @@
+# nsd
+
+Module uses the `nsd-control stats_noreset` command to provide `nsd` statistics.
+
+**Requirements:**
+ * Version of `nsd` must be 4.0+
+ * Netdata must have permissions to run `nsd-control stats_noreset`
+
+It produces:
+
+1. **Queries**
+ * queries
+
+2. **Zones**
+ * master
+ * slave
+
+3. **Protocol**
+ * udp
+ * udp6
+ * tcp
+ * tcp6
+
+4. **Query Type**
+ * A
+ * NS
+ * CNAME
+ * SOA
+ * PTR
+ * HINFO
+ * MX
+ * NAPTR
+ * TXT
+ * AAAA
+ * SRV
+ * ANY
+
+5. **Transfer**
+ * NOTIFY
+ * AXFR
+
+6. **Return Code**
+ * NOERROR
+ * FORMERR
+ * SERVFAIL
+ * NXDOMAIN
+ * NOTIMP
+ * REFUSED
+ * YXDOMAIN
+
+
+Configuration is not needed.
+
+---
diff --git a/python.d/nsd.chart.py b/collectors/python.d.plugin/nsd/nsd.chart.py
index 499dfda2e..d713f46bd 100644
--- a/python.d/nsd.chart.py
+++ b/collectors/python.d.plugin/nsd/nsd.chart.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Description: NSD `nsd-control stats_noreset` netdata python.d module
# Author: <383c57 at gmail.com>
+# SPDX-License-Identifier: GPL-3.0-or-later
import re
@@ -16,27 +17,29 @@ ORDER = ['queries', 'zones', 'protocol', 'type', 'transfer', 'rcode']
CHARTS = {
'queries': {
- 'options': [
- None, "queries", 'queries/s', 'queries', 'nsd.queries', 'line'],
+ 'options': [None, 'queries', 'queries/s', 'queries', 'nsd.queries', 'line'],
'lines': [
- ['num_queries', 'queries', 'incremental'],]},
+ ['num_queries', 'queries', 'incremental']
+ ]
+ },
'zones': {
- 'options': [
- None, "zones", 'zones', 'zones', 'nsd.zones', 'stacked'],
+ 'options': [None, 'zones', 'zones', 'zones', 'nsd.zones', 'stacked'],
'lines': [
['zone_master', 'master', 'absolute'],
- ['zone_slave', 'slave', 'absolute'],]},
+ ['zone_slave', 'slave', 'absolute']
+ ]
+ },
'protocol': {
- 'options': [
- None, "protocol", 'queries/s', 'protocol', 'nsd.protocols', 'stacked'],
+ 'options': [None, 'protocol', 'queries/s', 'protocol', 'nsd.protocols', 'stacked'],
'lines': [
['num_udp', 'udp', 'incremental'],
['num_udp6', 'udp6', 'incremental'],
['num_tcp', 'tcp', 'incremental'],
- ['num_tcp6', 'tcp6', 'incremental'],]},
+ ['num_tcp6', 'tcp6', 'incremental']
+ ]
+ },
'type': {
- 'options': [
- None, "query type", 'queries/s', 'query type', 'nsd.type', 'stacked'],
+ 'options': [None, 'query type', 'queries/s', 'query type', 'nsd.type', 'stacked'],
'lines': [
['num_type_A', 'A', 'incremental'],
['num_type_NS', 'NS', 'incremental'],
@@ -49,16 +52,18 @@ CHARTS = {
['num_type_TXT', 'TXT', 'incremental'],
['num_type_AAAA', 'AAAA', 'incremental'],
['num_type_SRV', 'SRV', 'incremental'],
- ['num_type_TYPE255', 'ANY', 'incremental'],]},
+ ['num_type_TYPE255', 'ANY', 'incremental']
+ ]
+ },
'transfer': {
- 'options': [
- None, "transfer", 'queries/s', 'transfer', 'nsd.transfer', 'stacked'],
+ 'options': [None, 'transfer', 'queries/s', 'transfer', 'nsd.transfer', 'stacked'],
'lines': [
['num_opcode_NOTIFY', 'NOTIFY', 'incremental'],
- ['num_type_TYPE252', 'AXFR', 'incremental'],]},
+ ['num_type_TYPE252', 'AXFR', 'incremental']
+ ]
+ },
'rcode': {
- 'options': [
- None, "return code", 'queries/s', 'return code', 'nsd.rcode', 'stacked'],
+ 'options': [None, 'return code', 'queries/s', 'return code', 'nsd.rcode', 'stacked'],
'lines': [
['num_rcode_NOERROR', 'NOERROR', 'incremental'],
['num_rcode_FORMERR', 'FORMERR', 'incremental'],
@@ -66,7 +71,9 @@ CHARTS = {
['num_rcode_NXDOMAIN', 'NXDOMAIN', 'incremental'],
['num_rcode_NOTIMP', 'NOTIMP', 'incremental'],
['num_rcode_REFUSED', 'REFUSED', 'incremental'],
- ['num_rcode_YXDOMAIN', 'YXDOMAIN', 'incremental'],]}
+ ['num_rcode_YXDOMAIN', 'YXDOMAIN', 'incremental']
+ ]
+ }
}
@@ -74,7 +81,7 @@ class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
ExecutableService.__init__(
self, configuration=configuration, name=name)
- self.command = "nsd-control stats_noreset"
+ self.command = 'nsd-control stats_noreset'
self.order = ORDER
self.definitions = CHARTS
self.regex = re.compile(r'([A-Za-z0-9.]+)=(\d+)')
diff --git a/conf.d/python.d/nsd.conf b/collectors/python.d.plugin/nsd/nsd.conf
index 078e97216..078e97216 100644
--- a/conf.d/python.d/nsd.conf
+++ b/collectors/python.d.plugin/nsd/nsd.conf