@cryptotaxi247 / netdata-1 / commits / 25c2c599d

remove python.d/nsd (#18300)

Ilya Mashchenko committed Aug 11, 2024 at 19:11 UTC 25c2c599d0a95cf98a7db5691e95466aa86b141a
6 files changed -632
CMakeLists.txt
-2
@@ -2786,7 +2786,6 @@ install(FILES
2786 src/collectors/python.d.plugin/go_expvar/go_expvar.conf
2787 src/collectors/python.d.plugin/haproxy/haproxy.conf
2788 src/collectors/python.d.plugin/monit/monit.conf
2789 - src/collectors/python.d.plugin/nsd/nsd.conf
2789 src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.conf
2790 src/collectors/python.d.plugin/openldap/openldap.conf
2791 src/collectors/python.d.plugin/oracledb/oracledb.conf
@@ -2816,7 +2815,6 @@ install(FILES
2815 src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
2816 src/collectors/python.d.plugin/haproxy/haproxy.chart.py
2817 src/collectors/python.d.plugin/monit/monit.chart.py
2819 - src/collectors/python.d.plugin/nsd/nsd.chart.py
2818 src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
2819 src/collectors/python.d.plugin/openldap/openldap.chart.py
2820 src/collectors/python.d.plugin/oracledb/oracledb.chart.py
src/collectors/python.d.plugin/nsd/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/name_server_daemon.md
\ No newline at end of file
src/collectors/python.d.plugin/nsd/integrations/name_server_daemon.md deleted
-232
@@ -1,232 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/nsd/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/nsd/metadata.yaml"
4 -sidebar_label: "Name Server Daemon"
5 -learn_status: "Published"
6 -learn_rel_path: "Collecting Metrics/DNS and DHCP Servers"
7 -most_popular: False
8 -message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
9 -endmeta-->
10 -
11 -# Name Server Daemon
12 -
13 -
14 -<img src="https://netdata.cloud/img/nsd.svg" width="150"/>
15 -
16 -
17 -Plugin: python.d.plugin
18 -Module: nsd
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -This collector monitors NSD statistics like queries, zones, protocols, query types and more.
25 -
26 -
27 -It uses the `nsd-control stats_noreset` command to gather metrics.
28 -
29 -
30 -This collector is supported on all platforms.
31 -
32 -This collector only supports collecting metrics from a single instance of this integration.
33 -
34 -
35 -### Default Behavior
36 -
37 -#### Auto-Detection
38 -
39 -If permissions are satisfied, the collector will be able to run `nsd-control stats_noreset`, thus collecting metrics.
40 -
41 -#### Limits
42 -
43 -The default configuration for this integration does not impose any limits on data collection.
44 -
45 -#### Performance Impact
46 -
47 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
48 -
49 -
50 -## Metrics
51 -
52 -Metrics grouped by *scope*.
53 -
54 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
55 -
56 -
57 -
58 -### Per Name Server Daemon instance
59 -
60 -These metrics refer to the entire monitored application.
61 -
62 -This scope has no labels.
63 -
64 -Metrics:
65 -
66 -| Metric | Dimensions | Unit |
67 -|:------|:----------|:----|
68 -| nsd.queries | queries | queries/s |
69 -| nsd.zones | master, slave | zones |
70 -| nsd.protocols | udp, udp6, tcp, tcp6 | queries/s |
71 -| nsd.type | A, NS, CNAME, SOA, PTR, HINFO, MX, NAPTR, TXT, AAAA, SRV, ANY | queries/s |
72 -| nsd.transfer | NOTIFY, AXFR | queries/s |
73 -| nsd.rcode | NOERROR, FORMERR, SERVFAIL, NXDOMAIN, NOTIMP, REFUSED, YXDOMAIN | queries/s |
74 -
75 -
76 -
77 -## Alerts
78 -
79 -There are no alerts configured by default for this integration.
80 -
81 -
82 -## Setup
83 -
84 -### Prerequisites
85 -
86 -#### NSD version
87 -
88 -The version of `nsd` must be 4.0+.
89 -
90 -
91 -#### Provide Netdata the permissions to run the command
92 -
93 -Netdata must have permissions to run the `nsd-control stats_noreset` command.
94 -
95 -You can:
96 -
97 -- Add "netdata" user to "nsd" group:
98 - ```
99 - usermod -aG nsd netdata
100 - ```
101 -- Add Netdata to sudoers
102 - 1. Edit the sudoers file:
103 - ```
104 - visudo -f /etc/sudoers.d/netdata
105 - ```
106 - 2. Add the entry:
107 - ```
108 - Defaults:netdata !requiretty
109 - netdata ALL=(ALL) NOPASSWD: /usr/sbin/nsd-control stats_noreset
110 - ```
111 -
112 - > Note that you will need to set the `command` option to `sudo /usr/sbin/nsd-control stats_noreset` if you use this method.
113 -
114 -
115 -
116 -### Configuration
117 -
118 -#### File
119 -
120 -The configuration file name for this integration is `python.d/nsd.conf`.
121 -
122 -
123 -You can edit the configuration file using the `edit-config` script from the
124 -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
125 -
126 -```bash
127 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
128 -sudo ./edit-config python.d/nsd.conf
129 -```
130 -#### Options
131 -
132 -This particular collector does not need further configuration to work if permissions are satisfied, but you can always customize it's data collection behavior.
133 -
134 -There are 2 sections:
135 -
136 -* Global variables
137 -* One or more JOBS that can define multiple different instances to monitor.
138 -
139 -The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
140 -
141 -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
142 -
143 -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
144 -
145 -
146 -<details open><summary>Config options</summary>
147 -
148 -| Name | Description | Default | Required |
149 -|:----|:-----------|:-------|:--------:|
150 -| update_every | Sets the default data collection frequency. | 30 | no |
151 -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
152 -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
153 -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
154 -| name | Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed running at any time. This allows autodetection to try several alternatives and pick the one that works. | | no |
155 -| command | The command to run | nsd-control stats_noreset | no |
156 -
157 -</details>
158 -
159 -#### Examples
160 -
161 -##### Basic
162 -
163 -A basic configuration example.
164 -
165 -```yaml
166 -local:
167 - name: 'nsd_local'
168 - command: 'nsd-control stats_noreset'
169 -
170 -```
171 -
172 -
173 -## Troubleshooting
174 -
175 -### Debug Mode
176 -
177 -To troubleshoot issues with the `nsd` collector, run the `python.d.plugin` with the debug option enabled. The output
178 -should give you clues as to why the collector isn't working.
179 -
180 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
181 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
182 -
183 - ```bash
184 - cd /usr/libexec/netdata/plugins.d/
185 - ```
186 -
187 -- Switch to the `netdata` user.
188 -
189 - ```bash
190 - sudo -u netdata -s
191 - ```
192 -
193 -- Run the `python.d.plugin` to debug the collector:
194 -
195 - ```bash
196 - ./python.d.plugin nsd debug trace
197 - ```
198 -
199 -### Getting Logs
200 -
201 -If you're encountering problems with the `nsd` collector, follow these steps to retrieve logs and identify potential issues:
202 -
203 -- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
204 -- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.
205 -
206 -#### System with systemd
207 -
208 -Use the following command to view logs generated since the last Netdata service restart:
209 -
210 -```bash
211 -journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep nsd
212 -```
213 -
214 -#### System without systemd
215 -
216 -Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
217 -
218 -```bash
219 -grep nsd /var/log/netdata/collector.log
220 -```
221 -
222 -**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
223 -
224 -#### Docker Container
225 -
226 -If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
227 -
228 -```bash
229 -docker logs netdata 2>&1 | grep nsd
230 -```
231 -
232 -
src/collectors/python.d.plugin/nsd/metadata.yaml deleted
-201
@@ -1,201 +0,0 @@
1 -plugin_name: python.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: python.d.plugin
5 - module_name: nsd
6 - monitored_instance:
7 - name: Name Server Daemon
8 - link: https://nsd.docs.nlnetlabs.nl/en/latest/#
9 - categories:
10 - - data-collection.dns-and-dhcp-servers
11 - icon_filename: "nsd.svg"
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ""
17 - keywords:
18 - - nsd
19 - - name server daemon
20 - most_popular: false
21 - overview:
22 - data_collection:
23 - metrics_description: |
24 - This collector monitors NSD statistics like queries, zones, protocols, query types and more.
25 - method_description: |
26 - It uses the `nsd-control stats_noreset` command to gather metrics.
27 - supported_platforms:
28 - include: []
29 - exclude: []
30 - multi_instance: false
31 - additional_permissions:
32 - description: ""
33 - default_behavior:
34 - auto_detection:
35 - description: If permissions are satisfied, the collector will be able to run `nsd-control stats_noreset`, thus collecting metrics.
36 - limits:
37 - description: ""
38 - performance_impact:
39 - description: ""
40 - setup:
41 - prerequisites:
42 - list:
43 - - title: NSD version
44 - description: |
45 - The version of `nsd` must be 4.0+.
46 - - title: Provide Netdata the permissions to run the command
47 - description: |
48 - Netdata must have permissions to run the `nsd-control stats_noreset` command.
49 -
50 - You can:
51 -
52 - - Add "netdata" user to "nsd" group:
53 - ```
54 - usermod -aG nsd netdata
55 - ```
56 - - Add Netdata to sudoers
57 - 1. Edit the sudoers file:
58 - ```
59 - visudo -f /etc/sudoers.d/netdata
60 - ```
61 - 2. Add the entry:
62 - ```
63 - Defaults:netdata !requiretty
64 - netdata ALL=(ALL) NOPASSWD: /usr/sbin/nsd-control stats_noreset
65 - ```
66 -
67 - > Note that you will need to set the `command` option to `sudo /usr/sbin/nsd-control stats_noreset` if you use this method.
68 -
69 - configuration:
70 - file:
71 - name: "python.d/nsd.conf"
72 - options:
73 - description: |
74 - This particular collector does not need further configuration to work if permissions are satisfied, but you can always customize it's data collection behavior.
75 -
76 - There are 2 sections:
77 -
78 - * Global variables
79 - * One or more JOBS that can define multiple different instances to monitor.
80 -
81 - The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values.
82 -
83 - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
84 -
85 - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
86 - folding:
87 - title: "Config options"
88 - enabled: true
89 - list:
90 - - name: update_every
91 - description: Sets the default data collection frequency.
92 - default_value: 30
93 - required: false
94 - - name: priority
95 - description: Controls the order of charts at the netdata dashboard.
96 - default_value: 60000
97 - required: false
98 - - name: autodetection_retry
99 - description: Sets the job re-check interval in seconds.
100 - default_value: 0
101 - required: false
102 - - name: penalty
103 - description: Indicates whether to apply penalty to update_every in case of failures.
104 - default_value: yes
105 - required: false
106 - - name: name
107 - description: >
108 - Job name. This value will overwrite the `job_name` value. JOBS with the same name are mutually exclusive. Only one of them will be allowed
109 - running at any time. This allows autodetection to try several alternatives and pick the one that works.
110 - default_value: ""
111 - required: false
112 - - name: command
113 - description: The command to run
114 - default_value: "nsd-control stats_noreset"
115 - required: false
116 - examples:
117 - folding:
118 - enabled: true
119 - title: "Config"
120 - list:
121 - - name: Basic
122 - description: A basic configuration example.
123 - folding:
124 - enabled: false
125 - config: |
126 - local:
127 - name: 'nsd_local'
128 - command: 'nsd-control stats_noreset'
129 - troubleshooting:
130 - problems:
131 - list: []
132 - alerts: []
133 - metrics:
134 - folding:
135 - title: Metrics
136 - enabled: false
137 - description: ""
138 - availability: []
139 - scopes:
140 - - name: global
141 - description: "These metrics refer to the entire monitored application."
142 - labels: []
143 - metrics:
144 - - name: nsd.queries
145 - description: queries
146 - unit: "queries/s"
147 - chart_type: line
148 - dimensions:
149 - - name: queries
150 - - name: nsd.zones
151 - description: zones
152 - unit: "zones"
153 - chart_type: stacked
154 - dimensions:
155 - - name: master
156 - - name: slave
157 - - name: nsd.protocols
158 - description: protocol
159 - unit: "queries/s"
160 - chart_type: stacked
161 - dimensions:
162 - - name: udp
163 - - name: udp6
164 - - name: tcp
165 - - name: tcp6
166 - - name: nsd.type
167 - description: query type
168 - unit: "queries/s"
169 - chart_type: stacked
170 - dimensions:
171 - - name: A
172 - - name: NS
173 - - name: CNAME
174 - - name: SOA
175 - - name: PTR
176 - - name: HINFO
177 - - name: MX
178 - - name: NAPTR
179 - - name: TXT
180 - - name: AAAA
181 - - name: SRV
182 - - name: ANY
183 - - name: nsd.transfer
184 - description: transfer
185 - unit: "queries/s"
186 - chart_type: stacked
187 - dimensions:
188 - - name: NOTIFY
189 - - name: AXFR
190 - - name: nsd.rcode
191 - description: return code
192 - unit: "queries/s"
193 - chart_type: stacked
194 - dimensions:
195 - - name: NOERROR
196 - - name: FORMERR
197 - - name: SERVFAIL
198 - - name: NXDOMAIN
199 - - name: NOTIMP
200 - - name: REFUSED
201 - - name: YXDOMAIN
src/collectors/python.d.plugin/nsd/nsd.chart.py deleted
-105
@@ -1,105 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: NSD `nsd-control stats_noreset` netdata python.d module
3 -# Author: <383c57 at gmail.com>
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -import re
7 -
8 -from bases.FrameworkServices.ExecutableService import ExecutableService
9 -
10 -update_every = 30
11 -
12 -NSD_CONTROL_COMMAND = 'nsd-control stats_noreset'
13 -REGEX = re.compile(r'([A-Za-z0-9.]+)=(\d+)')
14 -
15 -ORDER = [
16 - 'queries',
17 - 'zones',
18 - 'protocol',
19 - 'type',
20 - 'transfer',
21 - 'rcode',
22 -]
23 -
24 -CHARTS = {
25 - 'queries': {
26 - 'options': [None, 'queries', 'queries/s', 'queries', 'nsd.queries', 'line'],
27 - 'lines': [
28 - ['num_queries', 'queries', 'incremental']
29 - ]
30 - },
31 - 'zones': {
32 - 'options': [None, 'zones', 'zones', 'zones', 'nsd.zones', 'stacked'],
33 - 'lines': [
34 - ['zone_master', 'master', 'absolute'],
35 - ['zone_slave', 'slave', 'absolute']
36 - ]
37 - },
38 - 'protocol': {
39 - 'options': [None, 'protocol', 'queries/s', 'protocol', 'nsd.protocols', 'stacked'],
40 - 'lines': [
41 - ['num_udp', 'udp', 'incremental'],
42 - ['num_udp6', 'udp6', 'incremental'],
43 - ['num_tcp', 'tcp', 'incremental'],
44 - ['num_tcp6', 'tcp6', 'incremental']
45 - ]
46 - },
47 - 'type': {
48 - 'options': [None, 'query type', 'queries/s', 'query type', 'nsd.type', 'stacked'],
49 - 'lines': [
50 - ['num_type_A', 'A', 'incremental'],
51 - ['num_type_NS', 'NS', 'incremental'],
52 - ['num_type_CNAME', 'CNAME', 'incremental'],
53 - ['num_type_SOA', 'SOA', 'incremental'],
54 - ['num_type_PTR', 'PTR', 'incremental'],
55 - ['num_type_HINFO', 'HINFO', 'incremental'],
56 - ['num_type_MX', 'MX', 'incremental'],
57 - ['num_type_NAPTR', 'NAPTR', 'incremental'],
58 - ['num_type_TXT', 'TXT', 'incremental'],
59 - ['num_type_AAAA', 'AAAA', 'incremental'],
60 - ['num_type_SRV', 'SRV', 'incremental'],
61 - ['num_type_TYPE255', 'ANY', 'incremental']
62 - ]
63 - },
64 - 'transfer': {
65 - 'options': [None, 'transfer', 'queries/s', 'transfer', 'nsd.transfer', 'stacked'],
66 - 'lines': [
67 - ['num_opcode_NOTIFY', 'NOTIFY', 'incremental'],
68 - ['num_type_TYPE252', 'AXFR', 'incremental']
69 - ]
70 - },
71 - 'rcode': {
72 - 'options': [None, 'return code', 'queries/s', 'return code', 'nsd.rcode', 'stacked'],
73 - 'lines': [
74 - ['num_rcode_NOERROR', 'NOERROR', 'incremental'],
75 - ['num_rcode_FORMERR', 'FORMERR', 'incremental'],
76 - ['num_rcode_SERVFAIL', 'SERVFAIL', 'incremental'],
77 - ['num_rcode_NXDOMAIN', 'NXDOMAIN', 'incremental'],
78 - ['num_rcode_NOTIMP', 'NOTIMP', 'incremental'],
79 - ['num_rcode_REFUSED', 'REFUSED', 'incremental'],
80 - ['num_rcode_YXDOMAIN', 'YXDOMAIN', 'incremental']
81 - ]
82 - }
83 -}
84 -
85 -
86 -class Service(ExecutableService):
87 - def __init__(self, configuration=None, name=None):
88 - ExecutableService.__init__(self, configuration=configuration, name=name)
89 - self.order = ORDER
90 - self.definitions = CHARTS
91 - self.command = NSD_CONTROL_COMMAND
92 -
93 - def _get_data(self):
94 - lines = self._get_raw_data()
95 - if not lines:
96 - return None
97 -
98 - stats = dict(
99 - (k.replace('.', '_'), int(v)) for k, v in REGEX.findall(''.join(lines))
100 - )
101 - stats.setdefault('num_opcode_NOTIFY', 0)
102 - stats.setdefault('num_type_TYPE252', 0)
103 - stats.setdefault('num_type_TYPE255', 0)
104 -
105 - return stats
src/collectors/python.d.plugin/nsd/nsd.conf deleted
-91
@@ -1,91 +0,0 @@
1 -# netdata python.d.plugin configuration for nsd
2 -#
3 -# This file is in YaML format. Generally the format is:
4 -#
5 -# name: value
6 -#
7 -# There are 2 sections:
8 -# - global variables
9 -# - one or more JOBS
10 -#
11 -# JOBS allow you to collect values from multiple sources.
12 -# Each source will have its own set of charts.
13 -#
14 -# JOB parameters have to be indented (using spaces only, example below).
15 -
16 -# ----------------------------------------------------------------------
17 -# Global Variables
18 -# These variables set the defaults for all JOBs, however each JOB
19 -# may define its own, overriding the defaults.
20 -
21 -# update_every sets the default data collection frequency.
22 -# If unset, the python.d.plugin default is used.
23 -# nsd-control is slow, so once every 30 seconds
24 -# update_every: 30
25 -
26 -# priority controls the order of charts at the netdata dashboard.
27 -# Lower numbers move the charts towards the top of the page.
28 -# If unset, the default for python.d.plugin is used.
29 -# priority: 60000
30 -
31 -# penalty indicates whether to apply penalty to update_every in case of failures.
32 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
33 -# penalty: yes
34 -
35 -# autodetection_retry sets the job re-check interval in seconds.
36 -# The job is not deleted if check fails.
37 -# Attempts to start the job are made once every autodetection_retry.
38 -# This feature is disabled by default.
39 -# autodetection_retry: 0
40 -
41 -# ----------------------------------------------------------------------
42 -# JOBS (data collection sources)
43 -#
44 -# The default JOBS share the same *name*. JOBS with the same name
45 -# are mutually exclusive. Only one of them will be allowed running at
46 -# any time. This allows autodetection to try several alternatives and
47 -# pick the one that works.
48 -#
49 -# Any number of jobs is supported.
50 -#
51 -# All python.d.plugin JOBS (for all its modules) support a set of
52 -# predefined parameters. These are:
53 -#
54 -# job_name:
55 -# name: myname # the JOB's name as it will appear at the
56 -# # dashboard (by default is the job_name)
57 -# # JOBs sharing a name are mutually exclusive
58 -# update_every: 1 # the JOB's data collection frequency
59 -# priority: 60000 # the JOB's order on the dashboard
60 -# penalty: yes # the JOB's penalty
61 -# autodetection_retry: 0 # the JOB's re-check interval in seconds
62 -#
63 -# Additionally to the above, nsd also supports the following:
64 -#
65 -# command: 'nsd-control stats_noreset' # the command to run
66 -#
67 -
68 -# ----------------------------------------------------------------------
69 -# IMPORTANT Information
70 -#
71 -# Netdata must have permissions to run `nsd-control stats_noreset` command
72 -#
73 -# - Example-1 (use "sudo")
74 -# 1. sudoers (e.g. visudo -f /etc/sudoers.d/netdata)
75 -# Defaults:netdata !requiretty
76 -# netdata ALL=(ALL) NOPASSWD: /usr/sbin/nsd-control stats_noreset
77 -# 2. etc/netdata/python.d/nsd.conf
78 -# local:
79 -# update_every: 30
80 -# command: 'sudo /usr/sbin/nsd-control stats_noreset'
81 -#
82 -# - Example-2 (add "netdata" user to "nsd" group)
83 -# usermod -aG nsd netdata
84 -#
85 -
86 -# ----------------------------------------------------------------------
87 -# AUTO-DETECTION JOBS
88 -
89 -local:
90 - update_every: 30
91 - command: 'nsd-control stats_noreset'