@cryptotaxi247 / netdata-1 / commits / 3b1c4fa43

remove python.d/sensors (#17473)

Ilya Mashchenko committed Apr 22, 2024 at 12:51 UTC 3b1c4fa43834201643aa291cba0330b348c8ede3
7 files changed +1 -615
CMakeLists.txt
-2
@@ -2572,7 +2572,6 @@ install(FILES
2572 src/collectors/python.d.plugin/retroshare/retroshare.conf
2573 src/collectors/python.d.plugin/riakkv/riakkv.conf
2574 src/collectors/python.d.plugin/samba/samba.conf
2575 - src/collectors/python.d.plugin/sensors/sensors.conf
2575 src/collectors/python.d.plugin/smartd_log/smartd_log.conf
2576 src/collectors/python.d.plugin/spigotmc/spigotmc.conf
2577 src/collectors/python.d.plugin/squid/squid.conf
@@ -2620,7 +2619,6 @@ install(FILES
2619 src/collectors/python.d.plugin/retroshare/retroshare.chart.py
2620 src/collectors/python.d.plugin/riakkv/riakkv.chart.py
2621 src/collectors/python.d.plugin/samba/samba.chart.py
2623 - src/collectors/python.d.plugin/sensors/sensors.chart.py
2622 src/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
2623 src/collectors/python.d.plugin/spigotmc/spigotmc.chart.py
2624 src/collectors/python.d.plugin/squid/squid.chart.py
src/collectors/python.d.plugin/python.d.conf
+1 -1
@@ -63,7 +63,7 @@ hpssa: no
63 # retroshare: yes
64 # riakkv: yes
65 # samba: yes
66 -# sensors: yes
66 +sensors: no # replaced with go.d/sensors. Disabled for existing installations.
67 # smartd_log: yes
68 # spigotmc: yes
69 # squid: yes
src/collectors/python.d.plugin/sensors/README.md deleted
-1
@@ -1 +0,0 @@
1 -integrations/linux_sensors_lm-sensors.md
\ No newline at end of file
src/collectors/python.d.plugin/sensors/integrations/linux_sensors_lm-sensors.md deleted
-187
@@ -1,187 +0,0 @@
1 -<!--startmeta
2 -custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/sensors/README.md"
3 -meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/python.d.plugin/sensors/metadata.yaml"
4 -sidebar_label: "Linux Sensors (lm-sensors)"
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 -# Linux Sensors (lm-sensors)
12 -
13 -
14 -<img src="https://netdata.cloud/img/microchip.svg" width="150"/>
15 -
16 -
17 -Plugin: python.d.plugin
18 -Module: sensors
19 -
20 -<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21 -
22 -## Overview
23 -
24 -Examine Linux Sensors metrics with Netdata for insights into hardware health and performance.
25 -
26 -Enhance your system's reliability with real-time hardware health insights.
27 -
28 -
29 -Reads system sensors information (temperature, voltage, electric current, power, etc.) via [lm-sensors](https://hwmon.wiki.kernel.org/lm_sensors).
30 -
31 -
32 -This collector is supported on all platforms.
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 -The following type of sensors are auto-detected:
42 -- temperature - fan - voltage - current - power - energy - humidity
43 -
44 -
45 -#### Limits
46 -
47 -The default configuration for this integration does not impose any limits on data collection.
48 -
49 -#### Performance Impact
50 -
51 -The default configuration for this integration is not expected to impose a significant performance impact on the system.
52 -
53 -
54 -## Metrics
55 -
56 -Metrics grouped by *scope*.
57 -
58 -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
59 -
60 -
61 -
62 -### Per chip
63 -
64 -Metrics related to chips. Each chip provides a set of the following metrics, each having the chip name in the metric name as reported by `sensors -u`.
65 -
66 -
67 -This scope has no labels.
68 -
69 -Metrics:
70 -
71 -| Metric | Dimensions | Unit |
72 -|:------|:----------|:----|
73 -| sensors.temperature | a dimension per sensor | Celsius |
74 -| sensors.voltage | a dimension per sensor | Volts |
75 -| sensors.current | a dimension per sensor | Ampere |
76 -| sensors.power | a dimension per sensor | Watt |
77 -| sensors.fan | a dimension per sensor | Rotations/min |
78 -| sensors.energy | a dimension per sensor | Joule |
79 -| sensors.humidity | a dimension per sensor | Percent |
80 -
81 -
82 -
83 -## Alerts
84 -
85 -There are no alerts configured by default for this integration.
86 -
87 -
88 -## Setup
89 -
90 -### Prerequisites
91 -
92 -No action required.
93 -
94 -### Configuration
95 -
96 -#### File
97 -
98 -The configuration file name for this integration is `python.d/sensors.conf`.
99 -
100 -
101 -You can edit the configuration file using the `edit-config` script from the
102 -Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration.md#the-netdata-config-directory).
103 -
104 -```bash
105 -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
106 -sudo ./edit-config python.d/sensors.conf
107 -```
108 -#### Options
109 -
110 -There are 2 sections:
111 -
112 -* Global variables
113 -* One or more JOBS that can define multiple different instances to monitor.
114 -
115 -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.
116 -
117 -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
118 -
119 -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
120 -
121 -
122 -<details><summary>Config options</summary>
123 -
124 -| Name | Description | Default | Required |
125 -|:----|:-----------|:-------|:--------:|
126 -| types | The types of sensors to collect. | temperature, fan, voltage, current, power, energy, humidity | yes |
127 -| update_every | Sets the default data collection frequency. | 1 | no |
128 -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no |
129 -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no |
130 -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no |
131 -
132 -</details>
133 -
134 -#### Examples
135 -
136 -##### Default
137 -
138 -Default configuration.
139 -
140 -```yaml
141 -types:
142 - - temperature
143 - - fan
144 - - voltage
145 - - current
146 - - power
147 - - energy
148 - - humidity
149 -
150 -```
151 -
152 -
153 -## Troubleshooting
154 -
155 -### Debug Mode
156 -
157 -To troubleshoot issues with the `sensors` collector, run the `python.d.plugin` with the debug option enabled. The output
158 -should give you clues as to why the collector isn't working.
159 -
160 -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
161 - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
162 -
163 - ```bash
164 - cd /usr/libexec/netdata/plugins.d/
165 - ```
166 -
167 -- Switch to the `netdata` user.
168 -
169 - ```bash
170 - sudo -u netdata -s
171 - ```
172 -
173 -- Run the `python.d.plugin` to debug the collector:
174 -
175 - ```bash
176 - ./python.d.plugin sensors debug trace
177 - ```
178 -
179 -### lm-sensors doesn't work on your device
180 -
181 -
182 -
183 -### ACPI ring buffer errors are printed
184 -
185 -
186 -
187 -
src/collectors/python.d.plugin/sensors/metadata.yaml deleted
-184
@@ -1,184 +0,0 @@
1 -plugin_name: python.d.plugin
2 -modules:
3 - - meta:
4 - plugin_name: python.d.plugin
5 - module_name: sensors
6 - monitored_instance:
7 - name: Linux Sensors (lm-sensors)
8 - link: https://hwmon.wiki.kernel.org/lm_sensors
9 - categories:
10 - - data-collection.hardware-devices-and-sensors
11 - icon_filename: "microchip.svg"
12 - related_resources:
13 - integrations:
14 - list: []
15 - info_provided_to_referring_integrations:
16 - description: ""
17 - keywords:
18 - - sensors
19 - - temperature
20 - - voltage
21 - - current
22 - - power
23 - - fan
24 - - energy
25 - - humidity
26 - most_popular: false
27 - overview:
28 - data_collection:
29 - metrics_description: |
30 - Examine Linux Sensors metrics with Netdata for insights into hardware health and performance.
31 -
32 - Enhance your system's reliability with real-time hardware health insights.
33 - method_description: >
34 - Reads system sensors information (temperature, voltage, electric current, power, etc.) via [lm-sensors](https://hwmon.wiki.kernel.org/lm_sensors).
35 - supported_platforms:
36 - include: []
37 - exclude: []
38 - multi_instance: true
39 - additional_permissions:
40 - description: ""
41 - default_behavior:
42 - auto_detection:
43 - description: >
44 - The following type of sensors are auto-detected:
45 -
46 - - temperature
47 - - fan
48 - - voltage
49 - - current
50 - - power
51 - - energy
52 - - humidity
53 - limits:
54 - description: ""
55 - performance_impact:
56 - description: ""
57 - setup:
58 - prerequisites:
59 - list: []
60 - configuration:
61 - file:
62 - name: python.d/sensors.conf
63 - description: ""
64 - options:
65 - description: |
66 - There are 2 sections:
67 -
68 - * Global variables
69 - * One or more JOBS that can define multiple different instances to monitor.
70 -
71 - 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.
72 -
73 - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition.
74 -
75 - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified.
76 - folding:
77 - title: Config options
78 - enabled: true
79 - list:
80 - - name: types
81 - description: The types of sensors to collect.
82 - default_value: "temperature, fan, voltage, current, power, energy, humidity"
83 - required: true
84 - - name: update_every
85 - description: Sets the default data collection frequency.
86 - default_value: 1
87 - required: false
88 - - name: priority
89 - description: Controls the order of charts at the netdata dashboard.
90 - default_value: 60000
91 - required: false
92 - - name: autodetection_retry
93 - description: Sets the job re-check interval in seconds.
94 - default_value: 0
95 - required: false
96 - - name: penalty
97 - description: Indicates whether to apply penalty to update_every in case of failures.
98 - default_value: yes
99 - required: false
100 - examples:
101 - folding:
102 - enabled: true
103 - title: Config
104 - list:
105 - - name: Default
106 - folding:
107 - enabled: false
108 - description: Default configuration.
109 - config: |
110 - types:
111 - - temperature
112 - - fan
113 - - voltage
114 - - current
115 - - power
116 - - energy
117 - - humidity
118 - troubleshooting:
119 - problems:
120 - list:
121 - - name: lm-sensors doesn't work on your device
122 - description: |
123 - When `lm-sensors` doesn't work on your device (e.g. for RPi temperatures),
124 - use [the legacy bash collector](https://github.com/netdata/netdata/blob/master/src/collectors/charts.d.plugin/sensors/README.md)
125 - - name: ACPI ring buffer errors are printed
126 - description: |
127 - There have been reports from users that on certain servers, ACPI ring buffer errors are printed by the kernel (`dmesg`)
128 - when ACPI sensors are being accessed. We are tracking such cases in issue [#827](https://github.com/netdata/netdata/issues/827).
129 - Please join this discussion for help.
130 - alerts: []
131 - metrics:
132 - folding:
133 - title: Metrics
134 - enabled: false
135 - description: ""
136 - availability: []
137 - scopes:
138 - - name: chip
139 - description: >
140 - Metrics related to chips. Each chip provides a set of the following metrics, each having the chip name in the metric name as reported by `sensors -u`.
141 - labels: []
142 - metrics:
143 - - name: sensors.temperature
144 - description: Temperature
145 - unit: "Celsius"
146 - chart_type: line
147 - dimensions:
148 - - name: a dimension per sensor
149 - - name: sensors.voltage
150 - description: Voltage
151 - unit: "Volts"
152 - chart_type: line
153 - dimensions:
154 - - name: a dimension per sensor
155 - - name: sensors.current
156 - description: Current
157 - unit: "Ampere"
158 - chart_type: line
159 - dimensions:
160 - - name: a dimension per sensor
161 - - name: sensors.power
162 - description: Power
163 - unit: "Watt"
164 - chart_type: line
165 - dimensions:
166 - - name: a dimension per sensor
167 - - name: sensors.fan
168 - description: Fans speed
169 - unit: "Rotations/min"
170 - chart_type: line
171 - dimensions:
172 - - name: a dimension per sensor
173 - - name: sensors.energy
174 - description: Energy
175 - unit: "Joule"
176 - chart_type: line
177 - dimensions:
178 - - name: a dimension per sensor
179 - - name: sensors.humidity
180 - description: Humidity
181 - unit: "Percent"
182 - chart_type: line
183 - dimensions:
184 - - name: a dimension per sensor
src/collectors/python.d.plugin/sensors/sensors.chart.py deleted
-179
@@ -1,179 +0,0 @@
1 -# -*- coding: utf-8 -*-
2 -# Description: sensors netdata python.d plugin
3 -# Author: Pawel Krupa (paulfantom)
4 -# SPDX-License-Identifier: GPL-3.0-or-later
5 -
6 -from collections import defaultdict
7 -
8 -from bases.FrameworkServices.SimpleService import SimpleService
9 -from third_party import lm_sensors as sensors
10 -
11 -ORDER = [
12 - 'temperature',
13 - 'fan',
14 - 'voltage',
15 - 'current',
16 - 'power',
17 - 'energy',
18 - 'humidity',
19 -]
20 -
21 -# This is a prototype of chart definition which is used to dynamically create self.definitions
22 -CHARTS = {
23 - 'temperature': {
24 - 'options': [None, 'Temperature', 'Celsius', 'temperature', 'sensors.temperature', 'line'],
25 - 'lines': [
26 - [None, None, 'absolute', 1, 1000]
27 - ]
28 - },
29 - 'voltage': {
30 - 'options': [None, 'Voltage', 'Volts', 'voltage', 'sensors.voltage', 'line'],
31 - 'lines': [
32 - [None, None, 'absolute', 1, 1000]
33 - ]
34 - },
35 - 'current': {
36 - 'options': [None, 'Current', 'Ampere', 'current', 'sensors.current', 'line'],
37 - 'lines': [
38 - [None, None, 'absolute', 1, 1000]
39 - ]
40 - },
41 - 'power': {
42 - 'options': [None, 'Power', 'Watt', 'power', 'sensors.power', 'line'],
43 - 'lines': [
44 - [None, None, 'absolute', 1, 1000]
45 - ]
46 - },
47 - 'fan': {
48 - 'options': [None, 'Fans speed', 'Rotations/min', 'fans', 'sensors.fan', 'line'],
49 - 'lines': [
50 - [None, None, 'absolute', 1, 1000]
51 - ]
52 - },
53 - 'energy': {
54 - 'options': [None, 'Energy', 'Joule', 'energy', 'sensors.energy', 'line'],
55 - 'lines': [
56 - [None, None, 'incremental', 1, 1000]
57 - ]
58 - },
59 - 'humidity': {
60 - 'options': [None, 'Humidity', 'Percent', 'humidity', 'sensors.humidity', 'line'],
61 - 'lines': [
62 - [None, None, 'absolute', 1, 1000]
63 - ]
64 - }
65 -}
66 -
67 -LIMITS = {
68 - 'temperature': [-127, 1000],
69 - 'voltage': [-400, 400],
70 - 'current': [-127, 127],
71 - 'fan': [0, 65535]
72 -}
73 -
74 -TYPE_MAP = {
75 - 0: 'voltage',
76 - 1: 'fan',
77 - 2: 'temperature',
78 - 3: 'power',
79 - 4: 'energy',
80 - 5: 'current',
81 - 6: 'humidity',
82 - # 7: 'max_main',
83 - # 16: 'vid',
84 - # 17: 'intrusion',
85 - # 18: 'max_other',
86 - # 24: 'beep_enable'
87 -}
88 -
89 -
90 -class Service(SimpleService):
91 - def __init__(self, configuration=None, name=None):
92 - SimpleService.__init__(self, configuration=configuration, name=name)
93 - self.order = list()
94 - self.definitions = dict()
95 - self.chips = configuration.get('chips')
96 - self.priority = 60000
97 -
98 - def get_data(self):
99 - seen, data = dict(), dict()
100 - try:
101 - for chip in sensors.ChipIterator():
102 - chip_name = sensors.chip_snprintf_name(chip)
103 - seen[chip_name] = defaultdict(list)
104 -
105 - for feat in sensors.FeatureIterator(chip):
106 - if feat.type not in TYPE_MAP:
107 - continue
108 -
109 - feat_type = TYPE_MAP[feat.type]
110 - feat_name = str(feat.name.decode())
111 - feat_label = sensors.get_label(chip, feat)
112 - feat_limits = LIMITS.get(feat_type)
113 - sub_feat = next(sensors.SubFeatureIterator(chip, feat)) # current value
114 -
115 - if not sub_feat:
116 - continue
117 -
118 - try:
119 - v = sensors.get_value(chip, sub_feat.number)
120 - except sensors.SensorsError:
121 - continue
122 -
123 - if v is None:
124 - continue
125 -
126 - seen[chip_name][feat_type].append((feat_name, feat_label))
127 -
128 - if feat_limits and (v < feat_limits[0] or v > feat_limits[1]):
129 - continue
130 -
131 - data[chip_name + '_' + feat_name] = int(v * 1000)
132 -
133 - except sensors.SensorsError as error:
134 - self.error(error)
135 - return None
136 -
137 - self.update_sensors_charts(seen)
138 -
139 - return data or None
140 -
141 - def update_sensors_charts(self, seen):
142 - for chip_name, feat in seen.items():
143 - if self.chips and not any([chip_name.startswith(ex) for ex in self.chips]):
144 - continue
145 -
146 - for feat_type, sub_feat in feat.items():
147 - if feat_type not in ORDER or feat_type not in CHARTS:
148 - continue
149 -
150 - chart_id = '{}_{}'.format(chip_name, feat_type)
151 - if chart_id in self.charts:
152 - continue
153 -
154 - params = [chart_id] + list(CHARTS[feat_type]['options'])
155 - new_chart = self.charts.add_chart(params)
156 - new_chart.params['priority'] = self.get_chart_priority(feat_type)
157 -
158 - for name, label in sub_feat:
159 - lines = list(CHARTS[feat_type]['lines'][0])
160 - lines[0] = chip_name + '_' + name
161 - lines[1] = label
162 - new_chart.add_dimension(lines)
163 -
164 - def check(self):
165 - try:
166 - sensors.init()
167 - except sensors.SensorsError as error:
168 - self.error(error)
169 - return False
170 -
171 - self.priority = self.charts.priority
172 -
173 - return bool(self.get_data() and self.charts)
174 -
175 - def get_chart_priority(self, feat_type):
176 - for i, v in enumerate(ORDER):
177 - if v == feat_type:
178 - return self.priority + i
179 - return self.priority
src/collectors/python.d.plugin/sensors/sensors.conf deleted
-61
@@ -1,61 +0,0 @@
1 -# netdata python.d.plugin configuration for sensors
2 -#
3 -# This file is in YaML format. Generally the format is:
4 -#
5 -# name: value
6 -#
7 -
8 -# ----------------------------------------------------------------------
9 -# Global Variables
10 -# These variables set the defaults for all JOBs, however each JOB
11 -# may define its own, overriding the defaults.
12 -
13 -# update_every sets the default data collection frequency.
14 -# If unset, the python.d.plugin default is used.
15 -# update_every: 1
16 -
17 -# priority controls the order of charts at the netdata dashboard.
18 -# Lower numbers move the charts towards the top of the page.
19 -# If unset, the default for python.d.plugin is used.
20 -# priority: 60000
21 -
22 -# penalty indicates whether to apply penalty to update_every in case of failures.
23 -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
24 -# penalty: yes
25 -
26 -# autodetection_retry sets the job re-check interval in seconds.
27 -# The job is not deleted if check fails.
28 -# Attempts to start the job are made once every autodetection_retry.
29 -# This feature is disabled by default.
30 -# autodetection_retry: 0
31 -
32 -# ----------------------------------------------------------------------
33 -# Limit the number of sensors types.
34 -# Comment the ones you want to disable.
35 -# Also, re-arranging this list controls the order of the charts at the
36 -# netdata dashboard.
37 -
38 -types:
39 - - temperature
40 - - fan
41 - - voltage
42 - - current
43 - - power
44 - - energy
45 - - humidity
46 -
47 -# ----------------------------------------------------------------------
48 -# Limit the number of sensors chips.
49 -# Uncomment the first line (chips:) and add chip names below it.
50 -# The chip names that start with like that will be matched.
51 -# You can find the chip names using the sensors command.
52 -
53 -#chips:
54 -# - i8k
55 -# - coretemp
56 -#
57 -# chip names can be found using the sensors shell command
58 -# the prefix is matched (anything that starts like that)
59 -#
60 -#----------------------------------------------------------------------
61 -