@cryptotaxi247 / netdata-1 / commits / baa489303

remove python.d/retroshare (#18355)

Ilya Mashchenko committed Aug 17, 2024 at 19:58 UTC baa489303127291da7028e224a806b295bad86f2
6 files changed -521
CMakeLists.txt
-2
@@ -2786,7 +2786,6 @@ install(FILES
2786 src/collectors/python.d.plugin/openldap/openldap.conf
2787 src/collectors/python.d.plugin/oracledb/oracledb.conf
2788 src/collectors/python.d.plugin/pandas/pandas.conf
2789 - src/collectors/python.d.plugin/retroshare/retroshare.conf
2789 src/collectors/python.d.plugin/samba/samba.conf
2790 src/collectors/python.d.plugin/spigotmc/spigotmc.conf
2791 src/collectors/python.d.plugin/tor/tor.conf
@@ -2809,7 +2808,6 @@ install(FILES
2808 src/collectors/python.d.plugin/openldap/openldap.chart.py
2809 src/collectors/python.d.plugin/oracledb/oracledb.chart.py
2810 src/collectors/python.d.plugin/pandas/pandas.chart.py
2812 - src/collectors/python.d.plugin/retroshare/retroshare.chart.py
2811 src/collectors/python.d.plugin/samba/samba.chart.py
2812 src/collectors/python.d.plugin/spigotmc/spigotmc.chart.py
2813 src/collectors/python.d.plugin/tor/tor.chart.py
src/collectors/python.d.plugin/retroshare/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/retroshare.md
\ No newline at end of file
src/collectors/python.d.plugin/retroshare/integrations/retroshare.md deleted
-224
@@ -1,224 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/retroshare/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/retroshare/metadata.yaml"
4 -sidebar_label: "RetroShare"
5 -learn_status: "Published"
6 -learn_rel_path: "Collecting Metrics/Media Services"
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 -# RetroShare
12 -
13 -
14 -<img src="https://netdata.cloud/img/retroshare.png" width="150"/>
15 -
16 -
17 -Plugin: python.d.plugin
18 -Module: retroshare
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -This collector monitors RetroShare statistics such as application bandwidth, peers, and DHT metrics.
25 -
26 -It connects to the RetroShare web interface to gather metrics.
27 -
28 -This collector is supported on all platforms.
29 -
30 -This collector supports collecting metrics from multiple instances of this integration, including remote instances.
31 -
32 -
33 -### Default Behavior
34 -
35 -#### Auto-Detection
36 -
37 -The collector will attempt to connect and detect a RetroShare web interface through http://localhost:9090, even without any configuration.
38 -
39 -#### Limits
40 -
41 -The default configuration for this integration does not impose any limits on data collection.
42 -
43 -#### Performance Impact
44 -
45 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
46 -
47 -
48 -## Metrics
49 -
50 -Metrics grouped by *scope*.
51 -
52 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
53 -
54 -
55 -
56 -### Per RetroShare instance
57 -
58 -These metrics refer to the entire monitored application.
59 -
60 -This scope has no labels.
61 -
62 -Metrics:
63 -
64 -| Metric | Dimensions | Unit |
65 -|:------|:----------|:----|
66 -| retroshare.bandwidth | Upload, Download | kilobits/s |
67 -| retroshare.peers | All friends, Connected friends | peers |
68 -| retroshare.dht | DHT nodes estimated, RS nodes estimated | peers |
69 -
70 -
71 -
72 -## Alerts
73 -
74 -
75 -The following alerts are available:
76 -
77 -| Alert name | On metric | Description |
78 -|:------------|:----------|:------------|
79 -| [ retroshare_dht_working ](https://github.com/netdata/netdata/blob/master/src/health/health.d/retroshare.conf) | retroshare.dht | number of DHT peers |
80 -
81 -
82 -## Setup
83 -
84 -### Prerequisites
85 -
86 -#### RetroShare web interface
87 -
88 -RetroShare needs to be configured to enable the RetroShare WEB Interface and allow access from the Netdata host.
89 -
90 -
91 -
92 -### Configuration
93 -
94 -#### File
95 -
96 -The configuration file name for this integration is `python.d/retroshare.conf`.
97 -
98 -
99 -You can edit the configuration file using the `edit-config` script from the
100 -Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
101 -
102 -```bash
103 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
104 -sudo ./edit-config python.d/retroshare.conf
105 -```
106 -#### Options
107 -
108 -There are 2 sections:
109 -
110 -* Global variables
111 -* One or more JOBS that can define multiple different instances to monitor.
112 -
113 -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.
114 -
115 -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
116 -
117 -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
118 -
119 -
120 -<details open><summary>Config options</summary>
121 -
122 -| Name | Description | Default | Required |
123 -|:----|:-----------|:-------|:--------:|
124 -| update_every | Sets the default data collection frequency. | 5 | no |
125 -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
126 -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
127 -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
128 -| 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 |
129 -| url | The URL to the RetroShare Web UI. | http://localhost:9090 | no |
130 -
131 -</details>
132 -
133 -#### Examples
134 -
135 -##### Local RetroShare Web UI
136 -
137 -A basic configuration for a RetroShare server running on localhost.
138 -
139 -<details open><summary>Config</summary>
140 -
141 -```yaml
142 -localhost:
143 - name: 'local retroshare'
144 - url: 'http://localhost:9090'
145 -
146 -```
147 -</details>
148 -
149 -##### Remote RetroShare Web UI
150 -
151 -A basic configuration for a remote RetroShare server.
152 -
153 -<details open><summary>Config</summary>
154 -
155 -```yaml
156 -remote:
157 - name: 'remote retroshare'
158 - url: 'http://1.2.3.4:9090'
159 -
160 -```
161 -</details>
162 -
163 -
164 -
165 -## Troubleshooting
166 -
167 -### Debug Mode
168 -
169 -To troubleshoot issues with the `retroshare` collector, run the `python.d.plugin` with the debug option enabled. The output
170 -should give you clues as to why the collector isn't working.
171 -
172 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
173 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
174 -
175 - ```bash
176 - cd /usr/libexec/netdata/plugins.d/
177 - ```
178 -
179 -- Switch to the `netdata` user.
180 -
181 - ```bash
182 - sudo -u netdata -s
183 - ```
184 -
185 -- Run the `python.d.plugin` to debug the collector:
186 -
187 - ```bash
188 - ./python.d.plugin retroshare debug trace
189 - ```
190 -
191 -### Getting Logs
192 -
193 -If you're encountering problems with the `retroshare` collector, follow these steps to retrieve logs and identify potential issues:
194 -
195 -- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
196 -- **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.
197 -
198 -#### System with systemd
199 -
200 -Use the following command to view logs generated since the last Netdata service restart:
201 -
202 -```bash
203 -journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep retroshare
204 -```
205 -
206 -#### System without systemd
207 -
208 -Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
209 -
210 -```bash
211 -grep retroshare /var/log/netdata/collector.log
212 -```
213 -
214 -**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
215 -
216 -#### Docker Container
217 -
218 -If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
219 -
220 -```bash
221 -docker logs netdata 2>&1 | grep retroshare
222 -```
223 -
224 -
src/collectors/python.d.plugin/retroshare/metadata.yaml deleted
-144
@@ -1,144 +0,0 @@
1 -plugin_name: python.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: python.d.plugin
5 - module_name: retroshare
6 - monitored_instance:
7 - name: RetroShare
8 - link: "https://retroshare.cc/"
9 - categories:
10 - - data-collection.media-streaming-servers
11 - icon_filename: "retroshare.png"
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ""
17 - keywords:
18 - - retroshare
19 - - p2p
20 - most_popular: false
21 - overview:
22 - data_collection:
23 - metrics_description: "This collector monitors RetroShare statistics such as application bandwidth, peers, and DHT metrics."
24 - method_description: "It connects to the RetroShare web interface to gather metrics."
25 - supported_platforms:
26 - include: []
27 - exclude: []
28 - multi_instance: true
29 - additional_permissions:
30 - description: ""
31 - default_behavior:
32 - auto_detection:
33 - description: "The collector will attempt to connect and detect a RetroShare web interface through http://localhost:9090, even without any configuration."
34 - limits:
35 - description: ""
36 - performance_impact:
37 - description: ""
38 - setup:
39 - prerequisites:
40 - list:
41 - - title: "RetroShare web interface"
42 - description: |
43 - RetroShare needs to be configured to enable the RetroShare WEB Interface and allow access from the Netdata host.
44 - configuration:
45 - file:
46 - name: python.d/retroshare.conf
47 - options:
48 - description: |
49 - There are 2 sections:
50 -
51 - * Global variables
52 - * One or more JOBS that can define multiple different instances to monitor.
53 -
54 - 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.
55 -
56 - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
57 -
58 - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
59 - folding:
60 - title: "Config options"
61 - enabled: true
62 - list:
63 - - name: update_every
64 - description: Sets the default data collection frequency.
65 - default_value: 5
66 - required: false
67 - - name: priority
68 - description: Controls the order of charts at the netdata dashboard.
69 - default_value: 60000
70 - required: false
71 - - name: autodetection_retry
72 - description: Sets the job re-check interval in seconds.
73 - default_value: 0
74 - required: false
75 - - name: penalty
76 - description: Indicates whether to apply penalty to update_every in case of failures.
77 - default_value: yes
78 - required: false
79 - - name: name
80 - description: 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.
81 - default_value: ""
82 - required: false
83 - - name: url
84 - description: The URL to the RetroShare Web UI.
85 - default_value: "http://localhost:9090"
86 - required: false
87 - examples:
88 - folding:
89 - enabled: true
90 - title: "Config"
91 - list:
92 - - name: Local RetroShare Web UI
93 - description: A basic configuration for a RetroShare server running on localhost.
94 - config: |
95 - localhost:
96 - name: 'local retroshare'
97 - url: 'http://localhost:9090'
98 - - name: Remote RetroShare Web UI
99 - description: A basic configuration for a remote RetroShare server.
100 - config: |
101 - remote:
102 - name: 'remote retroshare'
103 - url: 'http://1.2.3.4:9090'
104 -
105 - troubleshooting:
106 - problems:
107 - list: []
108 - alerts:
109 - - name: retroshare_dht_working
110 - link: https://github.com/netdata/netdata/blob/master/src/health/health.d/retroshare.conf
111 - metric: retroshare.dht
112 - info: number of DHT peers
113 - metrics:
114 - folding:
115 - title: Metrics
116 - enabled: false
117 - description: ""
118 - availability: []
119 - scopes:
120 - - name: global
121 - description: "These metrics refer to the entire monitored application."
122 - labels: []
123 - metrics:
124 - - name: retroshare.bandwidth
125 - description: RetroShare Bandwidth
126 - unit: "kilobits/s"
127 - chart_type: area
128 - dimensions:
129 - - name: Upload
130 - - name: Download
131 - - name: retroshare.peers
132 - description: RetroShare Peers
133 - unit: "peers"
134 - chart_type: line
135 - dimensions:
136 - - name: All friends
137 - - name: Connected friends
138 - - name: retroshare.dht
139 - description: Retroshare DHT
140 - unit: "peers"
141 - chart_type: line
142 - dimensions:
143 - - name: DHT nodes estimated
144 - - name: RS nodes estimated
src/collectors/python.d.plugin/retroshare/retroshare.chart.py deleted
-78
@@ -1,78 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: RetroShare netdata python.d module
3 -# Authors: sehraf
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -import json
7 -
8 -from bases.FrameworkServices.UrlService import UrlService
9 -
10 -ORDER = [
11 - 'bandwidth',
12 - 'peers',
13 - 'dht',
14 -]
15 -
16 -CHARTS = {
17 - 'bandwidth': {
18 - 'options': [None, 'RetroShare Bandwidth', 'kilobits/s', 'RetroShare', 'retroshare.bandwidth', 'area'],
19 - 'lines': [
20 - ['bandwidth_up_kb', 'Upload'],
21 - ['bandwidth_down_kb', 'Download']
22 - ]
23 - },
24 - 'peers': {
25 - 'options': [None, 'RetroShare Peers', 'peers', 'RetroShare', 'retroshare.peers', 'line'],
26 - 'lines': [
27 - ['peers_all', 'All friends'],
28 - ['peers_connected', 'Connected friends']
29 - ]
30 - },
31 - 'dht': {
32 - 'options': [None, 'Retroshare DHT', 'peers', 'RetroShare', 'retroshare.dht', 'line'],
33 - 'lines': [
34 - ['dht_size_all', 'DHT nodes estimated'],
35 - ['dht_size_rs', 'RS nodes estimated']
36 - ]
37 - }
38 -}
39 -
40 -
41 -class Service(UrlService):
42 - def __init__(self, configuration=None, name=None):
43 - UrlService.__init__(self, configuration=configuration, name=name)
44 - self.order = ORDER
45 - self.definitions = CHARTS
46 - self.baseurl = self.configuration.get('url', 'http://localhost:9090')
47 -
48 - def _get_stats(self):
49 - """
50 - Format data received from http request
51 - :return: dict
52 - """
53 - try:
54 - raw = self._get_raw_data()
55 - parsed = json.loads(raw)
56 - if str(parsed['returncode']) != 'ok':
57 - return None
58 - except (TypeError, ValueError):
59 - return None
60 -
61 - return parsed['data'][0]
62 -
63 - def _get_data(self):
64 - """
65 - Get data from API
66 - :return: dict
67 - """
68 - self.url = self.baseurl + '/api/v2/stats'
69 - data = self._get_stats()
70 - if data is None:
71 - return None
72 -
73 - data['bandwidth_up_kb'] = data['bandwidth_up_kb'] * -1
74 - if data['dht_active'] is False:
75 - data['dht_size_all'] = None
76 - data['dht_size_rs'] = None
77 -
78 - return data
src/collectors/python.d.plugin/retroshare/retroshare.conf deleted
-72
@@ -1,72 +0,0 @@
1 -# netdata python.d.plugin configuration for RetroShare
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 -# update_every: 1
24 -
25 -# priority controls the order of charts at the netdata dashboard.
26 -# Lower numbers move the charts towards the top of the page.
27 -# If unset, the default for python.d.plugin is used.
28 -# priority: 60000
29 -
30 -# penalty indicates whether to apply penalty to update_every in case of failures.
31 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
32 -# penalty: yes
33 -
34 -# autodetection_retry sets the job re-check interval in seconds.
35 -# The job is not deleted if check fails.
36 -# Attempts to start the job are made once every autodetection_retry.
37 -# This feature is disabled by default.
38 -# autodetection_retry: 0
39 -
40 -# ----------------------------------------------------------------------
41 -# JOBS (data collection sources)
42 -#
43 -# The default JOBS share the same *name*. JOBS with the same name
44 -# are mutually exclusive. Only one of them will be allowed running at
45 -# any time. This allows autodetection to try several alternatives and
46 -# pick the one that works.
47 -#
48 -# Any number of jobs is supported.
49 -#
50 -# All python.d.plugin JOBS (for all its modules) support a set of
51 -# predefined parameters. These are:
52 -#
53 -# job_name:
54 -# name: myname # the JOB's name as it will appear at the
55 -# # dashboard (by default is the job_name)
56 -# # JOBs sharing a name are mutually exclusive
57 -# update_every: 1 # the JOB's data collection frequency
58 -# priority: 60000 # the JOB's order on the dashboard
59 -# penalty: yes # the JOB's penalty
60 -# autodetection_retry: 0 # the JOB's re-check interval in seconds
61 -#
62 -# Additionally to the above, RetroShare also supports the following:
63 -#
64 -# - url: 'url' # the URL to the WebUI
65 -#
66 -# ----------------------------------------------------------------------
67 -# AUTO-DETECTION JOBS
68 -# only one of them will run (they have the same name)
69 -
70 -localhost:
71 - name: 'local'
72 - url: 'http://localhost:9090'