@cryptotaxi247 / netdata-1 / commits / 94f6bd445

remove python.d/hddtemp (#17463)

Ilya Mashchenko committed Apr 21, 2024 at 17:20 UTC 94f6bd445638ab5b769d47d402f09b4d1d4f87b5
7 files changed +1 -578
CMakeLists.txt
-2
@@ -2555,7 +2555,6 @@ install(FILES
2555 src/collectors/python.d.plugin/gearman/gearman.conf
2556 src/collectors/python.d.plugin/go_expvar/go_expvar.conf
2557 src/collectors/python.d.plugin/haproxy/haproxy.conf
2558 - src/collectors/python.d.plugin/hddtemp/hddtemp.conf
2558 src/collectors/python.d.plugin/hpssa/hpssa.conf
2559 src/collectors/python.d.plugin/icecast/icecast.conf
2560 src/collectors/python.d.plugin/ipfs/ipfs.conf
@@ -2604,7 +2603,6 @@ install(FILES
2603 src/collectors/python.d.plugin/gearman/gearman.chart.py
2604 src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
2605 src/collectors/python.d.plugin/haproxy/haproxy.chart.py
2607 - src/collectors/python.d.plugin/hddtemp/hddtemp.chart.py
2606 src/collectors/python.d.plugin/hpssa/hpssa.chart.py
2607 src/collectors/python.d.plugin/icecast/icecast.chart.py
2608 src/collectors/python.d.plugin/ipfs/ipfs.chart.py
src/collectors/python.d.plugin/hddtemp/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/hdd_temperature.md
\ No newline at end of file
src/collectors/python.d.plugin/hddtemp/hddtemp.chart.py deleted
-99
@@ -1,99 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: hddtemp netdata python.d module
3 -# Author: Pawel Krupa (paulfantom)
4 -# Author: Ilya Mashchenko (ilyam8)
5 -# SPDX-License-Identifier: GPL-3.0-or-later
6 -
7 -
8 -import re
9 -from copy import deepcopy
10 -
11 -from bases.FrameworkServices.SocketService import SocketService
12 -
13 -ORDER = [
14 - 'temperatures',
15 -]
16 -
17 -CHARTS = {
18 - 'temperatures': {
19 - 'options': ['disks_temp', 'Disks Temperatures', 'Celsius', 'temperatures', 'hddtemp.temperatures', 'line'],
20 - 'lines': [
21 - # lines are created dynamically in `check()` method
22 - ]}}
23 -
24 -RE = re.compile(r'\/dev\/([^|]+)\|([^|]+)\|([0-9]+|SLP|UNK)\|')
25 -
26 -
27 -class Disk:
28 - def __init__(self, id_, name, temp):
29 - self.id = id_.split('/')[-1]
30 - self.name = name.replace(' ', '_')
31 - self.temp = temp if temp.isdigit() else None
32 -
33 - def __repr__(self):
34 - return self.id
35 -
36 -
37 -class Service(SocketService):
38 - def __init__(self, configuration=None, name=None):
39 - SocketService.__init__(self, configuration=configuration, name=name)
40 - self.order = ORDER
41 - self.definitions = deepcopy(CHARTS)
42 - self.do_only = self.configuration.get('devices')
43 - self._keep_alive = False
44 - self.request = ""
45 - self.host = "127.0.0.1"
46 - self.port = 7634
47 -
48 - def get_disks(self):
49 - r = self._get_raw_data()
50 -
51 - if not r:
52 - return None
53 -
54 - m = RE.findall(r)
55 -
56 - if not m:
57 - self.error("received data doesn't have needed records")
58 - return None
59 -
60 - rv = [Disk(*d) for d in m]
61 - self.debug('available disks: {0}'.format(rv))
62 -
63 - if self.do_only:
64 - return [v for v in rv if v.id in self.do_only]
65 - return rv
66 -
67 - def get_data(self):
68 - """
69 - Get data from TCP/IP socket
70 - :return: dict
71 - """
72 -
73 - disks = self.get_disks()
74 -
75 - if not disks:
76 - return None
77 -
78 - return dict((d.id, d.temp) for d in disks)
79 -
80 - def check(self):
81 - """
82 - Parse configuration, check if hddtemp is available, and dynamically create chart lines data
83 - :return: boolean
84 - """
85 - self._parse_config()
86 - disks = self.get_disks()
87 -
88 - if not disks:
89 - return False
90 -
91 - for d in disks:
92 - dim = [d.id]
93 - self.definitions['temperatures']['lines'].append(dim)
94 -
95 - return True
96 -
97 - @staticmethod
98 - def _check_raw_data(data):
99 - return not bool(data)
src/collectors/python.d.plugin/hddtemp/hddtemp.conf deleted
-95
@@ -1,95 +0,0 @@
1 -# netdata python.d.plugin configuration for hddtemp
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, hddtemp also supports the following:
63 -#
64 -# host: 'IP or HOSTNAME' # the host to connect to
65 -# port: PORT # the port to connect to
66 -#
67 -
68 -# By default this module will try to autodetect disks
69 -# (autodetection works only for disk which names start with "sd").
70 -# However this can be overridden by setting variable `disks` to
71 -# array of desired disks. Example for two disks:
72 -#
73 -# devices:
74 -# - sda
75 -# - sdb
76 -#
77 -
78 -# ----------------------------------------------------------------------
79 -# AUTO-DETECTION JOBS
80 -# only one of them will run (they have the same name)
81 -
82 -localhost:
83 - name: 'local'
84 - host: 'localhost'
85 - port: 7634
86 -
87 -localipv4:
88 - name: 'local'
89 - host: '127.0.0.1'
90 - port: 7634
91 -
92 -localipv6:
93 - name: 'local'
94 - host: '::1'
95 - port: 7634
src/collectors/python.d.plugin/hddtemp/integrations/hdd_temperature.md deleted
-217
@@ -1,217 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/hddtemp/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/hddtemp/metadata.yaml"
4 -sidebar_label: "HDD temperature"
5 -learn_status: "Published"
6 -learn_rel_path: "Collecting Metrics/Hardware Devices and Sensors"
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 -# HDD temperature
12 -
13 -
14 -<img src="https://netdata.cloud/img/hard-drive.svg" width="150"/>
15 -
16 -
17 -Plugin: python.d.plugin
18 -Module: hddtemp
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -This collector monitors disk temperatures.
25 -
26 -
27 -It uses the `hddtemp` daemon to gather the metrics.
28 -
29 -
30 -This collector is only supported on the following platforms:
31 -
32 -- Linux
33 -
34 -This collector supports collecting metrics from multiple instances of this integration, including remote instances.
35 -
36 -
37 -### Default Behavior
38 -
39 -#### Auto-Detection
40 -
41 -By default, this collector will attempt to connect to the `hddtemp` daemon on `127.0.0.1:7634`
42 -
43 -#### Limits
44 -
45 -The default configuration for this integration does not impose any limits on data collection.
46 -
47 -#### Performance Impact
48 -
49 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
50 -
51 -
52 -## Metrics
53 -
54 -Metrics grouped by *scope*.
55 -
56 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
57 -
58 -
59 -
60 -### Per HDD temperature instance
61 -
62 -These metrics refer to the entire monitored application.
63 -
64 -This scope has no labels.
65 -
66 -Metrics:
67 -
68 -| Metric | Dimensions | Unit |
69 -|:------|:----------|:----|
70 -| hddtemp.temperatures | a dimension per disk | Celsius |
71 -
72 -
73 -
74 -## Alerts
75 -
76 -There are no alerts configured by default for this integration.
77 -
78 -
79 -## Setup
80 -
81 -### Prerequisites
82 -
83 -#### Run `hddtemp` in daemon mode
84 -
85 -You can execute `hddtemp` in TCP/IP daemon mode by using the `-d` argument.
86 -
87 -So running `hddtemp -d` would run the daemon, by default on port 7634.
88 -
89 -
90 -
91 -### Configuration
92 -
93 -#### File
94 -
95 -The configuration file name for this integration is `python.d/hddtemp.conf`.
96 -
97 -
98 -You can edit the configuration file using the `edit-config` script from the
99 -Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration.md#the-netdata-config-directory).
100 -
101 -```bash
102 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
103 -sudo ./edit-config python.d/hddtemp.conf
104 -```
105 -#### Options
106 -
107 -There are 2 sections:
108 -
109 -* Global variables
110 -* One or more JOBS that can define multiple different instances to monitor.
111 -
112 -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.
113 -
114 -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
115 -
116 -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
117 -
118 -By default this collector will try to autodetect disks (autodetection works only for disk which names start with "sd"). However this can be overridden by setting the option `disks` to an array of desired disks.
119 -
120 -
121 -<details><summary>Config options</summary>
122 -
123 -| Name | Description | Default | Required |
124 -|:----|:-----------|:-------|:--------:|
125 -| update_every | Sets the default data collection frequency. | 1 | no |
126 -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
127 -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
128 -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
129 -| 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. | local | no |
130 -| devices | Array of desired disks to detect, in case their name doesn't start with `sd`. | | no |
131 -| host | The IP or HOSTNAME to connect to. | localhost | yes |
132 -| port | The port to connect to. | 7634 | no |
133 -
134 -</details>
135 -
136 -#### Examples
137 -
138 -##### Basic
139 -
140 -A basic example configuration.
141 -
142 -```yaml
143 -localhost:
144 - name: 'local'
145 - host: '127.0.0.1'
146 - port: 7634
147 -
148 -```
149 -##### Custom disk names
150 -
151 -An example defining the disk names to detect.
152 -
153 -<details><summary>Config</summary>
154 -
155 -```yaml
156 -localhost:
157 - name: 'local'
158 - host: '127.0.0.1'
159 - port: 7634
160 - devices:
161 - - customdisk1
162 - - customdisk2
163 -
164 -```
165 -</details>
166 -
167 -##### Multi-instance
168 -
169 -> **Note**: When you define multiple jobs, their names must be unique.
170 -
171 -Collecting metrics from local and remote instances.
172 -
173 -
174 -<details><summary>Config</summary>
175 -
176 -```yaml
177 -localhost:
178 - name: 'local'
179 - host: '127.0.0.1'
180 - port: 7634
181 -
182 -remote_job:
183 - name : 'remote'
184 - host : 'http://192.0.2.1:2812'
185 -
186 -```
187 -</details>
188 -
189 -
190 -
191 -## Troubleshooting
192 -
193 -### Debug Mode
194 -
195 -To troubleshoot issues with the `hddtemp` collector, run the `python.d.plugin` with the debug option enabled. The output
196 -should give you clues as to why the collector isn't working.
197 -
198 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
199 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
200 -
201 - ```bash
202 - cd /usr/libexec/netdata/plugins.d/
203 - ```
204 -
205 -- Switch to the `netdata` user.
206 -
207 - ```bash
208 - sudo -u netdata -s
209 - ```
210 -
211 -- Run the `python.d.plugin` to debug the collector:
212 -
213 - ```bash
214 - ./python.d.plugin hddtemp debug trace
215 - ```
216 -
217 -
src/collectors/python.d.plugin/hddtemp/metadata.yaml deleted
-163
@@ -1,163 +0,0 @@
1 -plugin_name: python.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: python.d.plugin
5 - module_name: hddtemp
6 - monitored_instance:
7 - name: HDD temperature
8 - link: https://linux.die.net/man/8/hddtemp
9 - categories:
10 - - data-collection.hardware-devices-and-sensors
11 - icon_filename: "hard-drive.svg"
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ""
17 - keywords:
18 - - hardware
19 - - hdd temperature
20 - - disk temperature
21 - - temperature
22 - most_popular: false
23 - overview:
24 - data_collection:
25 - metrics_description: |
26 - This collector monitors disk temperatures.
27 - method_description: |
28 - It uses the `hddtemp` daemon to gather the metrics.
29 - supported_platforms:
30 - include:
31 - - Linux
32 - exclude: []
33 - multi_instance: true
34 - additional_permissions:
35 - description: ""
36 - default_behavior:
37 - auto_detection:
38 - description: By default, this collector will attempt to connect to the `hddtemp` daemon on `127.0.0.1:7634`
39 - limits:
40 - description: ""
41 - performance_impact:
42 - description: ""
43 - setup:
44 - prerequisites:
45 - list:
46 - - title: Run `hddtemp` in daemon mode
47 - description: |
48 - You can execute `hddtemp` in TCP/IP daemon mode by using the `-d` argument.
49 -
50 - So running `hddtemp -d` would run the daemon, by default on port 7634.
51 - configuration:
52 - file:
53 - name: "python.d/hddtemp.conf"
54 - options:
55 - description: |
56 - There are 2 sections:
57 -
58 - * Global variables
59 - * One or more JOBS that can define multiple different instances to monitor.
60 -
61 - 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.
62 -
63 - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
64 -
65 - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
66 -
67 - By default this collector will try to autodetect disks (autodetection works only for disk which names start with "sd"). However this can be overridden by setting the option `disks` to an array of desired disks.
68 - folding:
69 - title: "Config options"
70 - enabled: true
71 - list:
72 - - name: update_every
73 - description: Sets the default data collection frequency.
74 - default_value: 1
75 - required: false
76 - - name: priority
77 - description: Controls the order of charts at the netdata dashboard.
78 - default_value: 60000
79 - required: false
80 - - name: autodetection_retry
81 - description: Sets the job re-check interval in seconds.
82 - default_value: 0
83 - required: false
84 - - name: penalty
85 - description: Indicates whether to apply penalty to update_every in case of failures.
86 - default_value: yes
87 - required: false
88 - - name: name
89 - description: >
90 - 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.
91 - default_value: "local"
92 - required: false
93 - - name: devices
94 - description: Array of desired disks to detect, in case their name doesn't start with `sd`.
95 - default_value: ""
96 - required: false
97 - - name: host
98 - description: The IP or HOSTNAME to connect to.
99 - default_value: "localhost"
100 - required: true
101 - - name: port
102 - description: The port to connect to.
103 - default_value: 7634
104 - required: false
105 - examples:
106 - folding:
107 - enabled: true
108 - title: "Config"
109 - list:
110 - - name: Basic
111 - description: A basic example configuration.
112 - folding:
113 - enabled: false
114 - config: |
115 - localhost:
116 - name: 'local'
117 - host: '127.0.0.1'
118 - port: 7634
119 - - name: Custom disk names
120 - description: An example defining the disk names to detect.
121 - config: |
122 - localhost:
123 - name: 'local'
124 - host: '127.0.0.1'
125 - port: 7634
126 - devices:
127 - - customdisk1
128 - - customdisk2
129 - - name: Multi-instance
130 - description: |
131 - > **Note**: When you define multiple jobs, their names must be unique.
132 -
133 - Collecting metrics from local and remote instances.
134 - config: |
135 - localhost:
136 - name: 'local'
137 - host: '127.0.0.1'
138 - port: 7634
139 -
140 - remote_job:
141 - name : 'remote'
142 - host : 'http://192.0.2.1:2812'
143 - troubleshooting:
144 - problems:
145 - list: []
146 - alerts: []
147 - metrics:
148 - folding:
149 - title: Metrics
150 - enabled: false
151 - description: ""
152 - availability: []
153 - scopes:
154 - - name: global
155 - description: "These metrics refer to the entire monitored application."
156 - labels: []
157 - metrics:
158 - - name: hddtemp.temperatures
159 - description: Disk Temperatures
160 - unit: "Celsius"
161 - chart_type: line
162 - dimensions:
163 - - name: a dimension per disk
src/collectors/python.d.plugin/python.d.conf
+1 -1
@@ -44,7 +44,7 @@ example: no
44 go_expvar: no
45
46 # haproxy: yes
47 -# hddtemp: yes
47 +hddtemp: no # replaced with go.d/hddtemp. Disabled for existing installations.
48 hpssa: no
49 # icecast: yes
50 # ipfs: yes