remove charts.d/sensors (#18426)
Ilya Mashchenko committed
Aug 29, 2024 at 11:43 UTC
99298abec586a081a225d33963d72c120a1cfc54
6 files changed
-702
CMakeLists.txt
-2
@@ -2769,7 +2769,6 @@ install(PROGRAMS
2769
src/collectors/charts.d.plugin/example/example.chart.sh
2770
src/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
2771
src/collectors/charts.d.plugin/opensips/opensips.chart.sh
2772
- src/collectors/charts.d.plugin/sensors/sensors.chart.sh
2772
COMPONENT plugin-chartsd
2773
DESTINATION usr/libexec/netdata/charts.d)
2774
@@ -2778,7 +2777,6 @@ install(FILES
2777
src/collectors/charts.d.plugin/example/example.conf
2778
src/collectors/charts.d.plugin/libreswan/libreswan.conf
2779
src/collectors/charts.d.plugin/opensips/opensips.conf
2781
- src/collectors/charts.d.plugin/sensors/sensors.conf
2780
COMPONENT plugin-chartsd
2781
DESTINATION usr/lib/netdata/conf.d/charts.d)
2782
src/collectors/charts.d.plugin/sensors/README.md
deleted
-1
@@ -1 +0,0 @@
1
-integrations/linux_sensors_sysfs.md
\ No newline at end of file
src/collectors/charts.d.plugin/sensors/integrations/linux_sensors_sysfs.md
deleted
-235
@@ -1,235 +0,0 @@
1
-<!--startmeta
2
-custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/collectors/charts.d.plugin/sensors/README.md"
3
-meta_yaml: "https://github.com/netdata/netdata/edit/master/src/collectors/charts.d.plugin/sensors/metadata.yaml"
4
-sidebar_label: "Linux Sensors (sysfs)"
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 (sysfs)
12
-
13
-
14
-<img src="https://netdata.cloud/img/microchip.svg" width="150"/>
15
-
16
-
17
-Plugin: charts.d.plugin
18
-Module: sensors
19
-
20
-<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
21
-
22
-## Overview
23
-
24
-Use this collector when `lm-sensors` doesn't work on your device (e.g. for RPi temperatures).
25
-For all other cases use the [Go collector](/src/go/plugin/go.d/modules/sensors/README.md), which supports multiple jobs, is more efficient and performs calculations on top of the kernel provided values."
26
-
27
-
28
-It will provide charts for all configured system sensors, by reading sensors directly from the kernel.
29
-The values graphed are the raw hardware values of the sensors.
30
-
31
-
32
-This collector is only supported on the following platforms:
33
-
34
-- Linux
35
-
36
-This collector supports collecting metrics from multiple instances of this integration, including remote instances.
37
-
38
-
39
-### Default Behavior
40
-
41
-#### Auto-Detection
42
-
43
-By default, the collector will try to read entries under `/sys/devices`
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 sensor chip
63
-
64
-Metrics related to sensor chips. Each chip provides its own set of the following metrics.
65
-
66
-This scope has no labels.
67
-
68
-Metrics:
69
-
70
-| Metric | Dimensions | Unit |
71
-|:------|:----------|:----|
72
-| sensors.temp | {filename} | Celsius |
73
-| sensors.volt | {filename} | Volts |
74
-| sensors.curr | {filename} | Ampere |
75
-| sensors.power | {filename} | Watt |
76
-| sensors.fans | {filename} | Rotations / Minute |
77
-| sensors.energy | {filename} | Joule |
78
-| sensors.humidity | {filename} | Percent |
79
-
80
-
81
-
82
-## Alerts
83
-
84
-There are no alerts configured by default for this integration.
85
-
86
-
87
-## Setup
88
-
89
-### Prerequisites
90
-
91
-#### Install charts.d plugin
92
-
93
-If [using our official native DEB/RPM packages](/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.
94
-
95
-
96
-#### Enable the sensors collector
97
-
98
-The `sensors` collector is disabled by default. To enable it, use `edit-config` from the Netdata [config directory](/docs/netdata-agent/configuration/README.md), which is typically at `/etc/netdata`, to edit the `charts.d.conf` file.
99
-
100
-```bash
101
-cd /etc/netdata # Replace this path with your Netdata config directory, if different
102
-sudo ./edit-config charts.d.conf
103
-```
104
-
105
-Change the value of the `sensors` setting to `force` and uncomment the line. Save the file and restart the Netdata Agent with `sudo systemctl restart netdata`, or the [appropriate method](/packaging/installer/README.md#maintaining-a-netdata-agent-installation) for your system.
106
-
107
-
108
-
109
-### Configuration
110
-
111
-#### File
112
-
113
-The configuration file name for this integration is `charts.d/sensors.conf`.
114
-
115
-
116
-You can edit the configuration file using the `edit-config` script from the
117
-Netdata [config directory](/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
118
-
119
-```bash
120
-cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
121
-sudo ./edit-config charts.d/sensors.conf
122
-```
123
-#### Options
124
-
125
-The config file is sourced by the charts.d plugin. It's a standard bash file.
126
-
127
-The following collapsed table contains all the options that can be configured for the sensors collector.
128
-
129
-
130
-<details open><summary>Config options</summary>
131
-
132
-| Name | Description | Default | Required |
133
-|:----|:-----------|:-------|:--------:|
134
-| sensors_sys_dir | The directory the kernel exposes sensor data. | /sys/devices | no |
135
-| sensors_sys_depth | How deep in the tree to check for sensor data. | 10 | no |
136
-| sensors_source_update | If set to 1, the script will overwrite internal script functions with code generated ones. | 1 | no |
137
-| sensors_update_every | The data collection frequency. If unset, will inherit the netdata update frequency. | 1 | no |
138
-| sensors_priority | The charts priority on the dashboard. | 90000 | no |
139
-| sensors_retries | The number of retries to do in case of failure before disabling the collector. | 10 | no |
140
-
141
-</details>
142
-
143
-#### Examples
144
-
145
-##### Set sensors path depth
146
-
147
-Set a different sensors path depth
148
-
149
-```yaml
150
-# the directory the kernel keeps sensor data
151
-#sensors_sys_dir="/sys/devices"
152
-
153
-# how deep in the tree to check for sensor data
154
-sensors_sys_depth=5
155
-
156
-# if set to 1, the script will overwrite internal
157
-# script functions with code generated ones
158
-# leave to 1, is faster
159
-#sensors_source_update=1
160
-
161
-# the data collection frequency
162
-# if unset, will inherit the netdata update frequency
163
-#sensors_update_every=
164
-
165
-# the charts priority on the dashboard
166
-#sensors_priority=90000
167
-
168
-# the number of retries to do in case of failure
169
-# before disabling the module
170
-#sensors_retries=10
171
-
172
-```
173
-
174
-
175
-## Troubleshooting
176
-
177
-### Debug Mode
178
-
179
-
180
-To troubleshoot issues with the `sensors` collector, run the `charts.d.plugin` with the debug option enabled. The output
181
-should give you clues as to why the collector isn't working.
182
-
183
-- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
184
- your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
185
-
186
- ```bash
187
- cd /usr/libexec/netdata/plugins.d/
188
- ```
189
-
190
-- Switch to the `netdata` user.
191
-
192
- ```bash
193
- sudo -u netdata -s
194
- ```
195
-
196
-- Run the `charts.d.plugin` to debug the collector:
197
-
198
- ```bash
199
- ./charts.d.plugin debug 1 sensors
200
- ```
201
-
202
-### Getting Logs
203
-
204
-If you're encountering problems with the `sensors` collector, follow these steps to retrieve logs and identify potential issues:
205
-
206
-- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
207
-- **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.
208
-
209
-#### System with systemd
210
-
211
-Use the following command to view logs generated since the last Netdata service restart:
212
-
213
-```bash
214
-journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep sensors
215
-```
216
-
217
-#### System without systemd
218
-
219
-Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
220
-
221
-```bash
222
-grep sensors /var/log/netdata/collector.log
223
-```
224
-
225
-**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
226
-
227
-#### Docker Container
228
-
229
-If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
230
-
231
-```bash
232
-docker logs netdata 2>&1 | grep sensors
233
-```
234
-
235
-
src/collectors/charts.d.plugin/sensors/metadata.yaml
deleted
-182
@@ -1,182 +0,0 @@
1
-plugin_name: charts.d.plugin
2
-modules:
3
- - meta:
4
- plugin_name: charts.d.plugin
5
- module_name: sensors
6
- monitored_instance:
7
- name: Linux Sensors (sysfs)
8
- link: "https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface"
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
- - sysfs
20
- - hwmon
21
- - rpi
22
- - raspberry pi
23
- most_popular: false
24
- overview:
25
- data_collection:
26
- metrics_description: |
27
- Use this collector when `lm-sensors` doesn't work on your device (e.g. for RPi temperatures).
28
- For all other cases use the [Go collector](/src/go/plugin/go.d/modules/sensors/README.md), which supports multiple jobs, is more efficient and performs calculations on top of the kernel provided values."
29
- method_description: |
30
- It will provide charts for all configured system sensors, by reading sensors directly from the kernel.
31
- The values graphed are the raw hardware values of the sensors.
32
- supported_platforms:
33
- include: [Linux]
34
- exclude: []
35
- multi_instance: true
36
- additional_permissions:
37
- description: ""
38
- default_behavior:
39
- auto_detection:
40
- description: "By default, the collector will try to read entries under `/sys/devices`"
41
- limits:
42
- description: ""
43
- performance_impact:
44
- description: ""
45
- setup:
46
- prerequisites:
47
- list:
48
- - title: "Install charts.d plugin"
49
- description: |
50
- If [using our official native DEB/RPM packages](/packaging/installer/UPDATE.md#determine-which-installation-method-you-used), make sure `netdata-plugin-chartsd` is installed.
51
- - title: "Enable the sensors collector"
52
- description: |
53
- The `sensors` collector is disabled by default. To enable it, use `edit-config` from the Netdata [config directory](/docs/netdata-agent/configuration/README.md), which is typically at `/etc/netdata`, to edit the `charts.d.conf` file.
54
-
55
- ```bash
56
- cd /etc/netdata # Replace this path with your Netdata config directory, if different
57
- sudo ./edit-config charts.d.conf
58
- ```
59
-
60
- Change the value of the `sensors` setting to `force` and uncomment the line. Save the file and restart the Netdata Agent with `sudo systemctl restart netdata`, or the [appropriate method](/packaging/installer/README.md#maintaining-a-netdata-agent-installation) for your system.
61
- configuration:
62
- file:
63
- name: charts.d/sensors.conf
64
- options:
65
- description: |
66
- The config file is sourced by the charts.d plugin. It's a standard bash file.
67
-
68
- The following collapsed table contains all the options that can be configured for the sensors collector.
69
- folding:
70
- title: "Config options"
71
- enabled: true
72
- list:
73
- - name: sensors_sys_dir
74
- description: The directory the kernel exposes sensor data.
75
- default_value: "/sys/devices"
76
- required: false
77
- - name: sensors_sys_depth
78
- description: How deep in the tree to check for sensor data.
79
- default_value: 10
80
- required: false
81
- - name: sensors_source_update
82
- description: If set to 1, the script will overwrite internal script functions with code generated ones.
83
- default_value: 1
84
- required: false
85
- - name: sensors_update_every
86
- description: The data collection frequency. If unset, will inherit the netdata update frequency.
87
- default_value: 1
88
- required: false
89
- - name: sensors_priority
90
- description: The charts priority on the dashboard.
91
- default_value: 90000
92
- required: false
93
- - name: sensors_retries
94
- description: The number of retries to do in case of failure before disabling the collector.
95
- default_value: 10
96
- required: false
97
- examples:
98
- folding:
99
- enabled: false
100
- title: "Config"
101
- list:
102
- - name: Set sensors path depth
103
- description: Set a different sensors path depth
104
- config: |
105
- # the directory the kernel keeps sensor data
106
- #sensors_sys_dir="/sys/devices"
107
-
108
- # how deep in the tree to check for sensor data
109
- sensors_sys_depth=5
110
-
111
- # if set to 1, the script will overwrite internal
112
- # script functions with code generated ones
113
- # leave to 1, is faster
114
- #sensors_source_update=1
115
-
116
- # the data collection frequency
117
- # if unset, will inherit the netdata update frequency
118
- #sensors_update_every=
119
-
120
- # the charts priority on the dashboard
121
- #sensors_priority=90000
122
-
123
- # the number of retries to do in case of failure
124
- # before disabling the module
125
- #sensors_retries=10
126
- troubleshooting:
127
- problems:
128
- list: []
129
- alerts: []
130
- metrics:
131
- folding:
132
- title: Metrics
133
- enabled: false
134
- description: ""
135
- availability: []
136
- scopes:
137
- - name: sensor chip
138
- description: "Metrics related to sensor chips. Each chip provides its own set of the following metrics."
139
- labels: []
140
- metrics:
141
- - name: sensors.temp
142
- description: Temperature
143
- unit: "Celsius"
144
- chart_type: line
145
- dimensions:
146
- - name: "{filename}"
147
- - name: sensors.volt
148
- description: Voltage
149
- unit: "Volts"
150
- chart_type: line
151
- dimensions:
152
- - name: "{filename}"
153
- - name: sensors.curr
154
- description: Current
155
- unit: "Ampere"
156
- chart_type: line
157
- dimensions:
158
- - name: "{filename}"
159
- - name: sensors.power
160
- description: Power
161
- unit: "Watt"
162
- chart_type: line
163
- dimensions:
164
- - name: "{filename}"
165
- - name: sensors.fans
166
- description: Fans Speed
167
- unit: "Rotations / Minute"
168
- chart_type: line
169
- dimensions:
170
- - name: "{filename}"
171
- - name: sensors.energy
172
- description: Energy
173
- unit: "Joule"
174
- chart_type: area
175
- dimensions:
176
- - name: "{filename}"
177
- - name: sensors.humidity
178
- description: Humidity
179
- unit: "Percent"
180
- chart_type: line
181
- dimensions:
182
- - name: "{filename}"
src/collectors/charts.d.plugin/sensors/sensors.chart.sh
deleted
-250
@@ -1,250 +0,0 @@
1
-# shellcheck shell=bash
2
-# no need for shebang - this file is loaded from charts.d.plugin
3
-# SPDX-License-Identifier: GPL-3.0-or-later
4
-
5
-# netdata
6
-# real-time performance and health monitoring, done right!
7
-# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
8
-#
9
-
10
-# sensors docs
11
-# https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
12
-
13
-# if this chart is called X.chart.sh, then all functions and global variables
14
-# must start with X_
15
-
16
-# the directory the kernel keeps sensor data
17
-sensors_sys_dir="${NETDATA_HOST_PREFIX}/sys/devices"
18
-
19
-# how deep in the tree to check for sensor data
20
-sensors_sys_depth=10
21
-
22
-# if set to 1, the script will overwrite internal
23
-# script functions with code generated ones
24
-# leave to 1, is faster
25
-sensors_source_update=1
26
-
27
-# how frequently to collect sensor data
28
-# the default is to collect it at every iteration of charts.d
29
-sensors_update_every=
30
-
31
-sensors_priority=90000
32
-
33
-declare -A sensors_excluded=()
34
-
35
-sensors_find_all_files() {
36
- find "$1" -maxdepth $sensors_sys_depth -name \*_input -o -name temp 2>/dev/null
37
-}
38
-
39
-sensors_find_all_dirs() {
40
- # shellcheck disable=SC2162
41
- sensors_find_all_files "$1" | while read; do
42
- dirname "$REPLY"
43
- done | sort -u
44
-}
45
-
46
-# _check is called once, to find out if this chart should be enabled or not
47
-sensors_check() {
48
-
49
- # this should return:
50
- # - 0 to enable the chart
51
- # - 1 to disable the chart
52
-
53
- [ -z "$(sensors_find_all_files "$sensors_sys_dir")" ] && error "no sensors found in '$sensors_sys_dir'." && return 1
54
- return 0
55
-}
56
-
57
-sensors_check_files() {
58
- # we only need sensors that report a non-zero value
59
- # also remove not needed sensors
60
-
61
- local f v excluded
62
- for f in "$@"; do
63
- [ ! -f "$f" ] && continue
64
- for ex in "${sensors_excluded[@]}"; do
65
- [[ $f =~ .*$ex$ ]] && excluded='1' && break
66
- done
67
-
68
- [ "$excluded" != "1" ] && v="$(cat "$f")" || v=0
69
- v=$((v + 1 - 1))
70
- [ $v -ne 0 ] && echo "$f" && continue
71
- excluded=
72
-
73
- error "$f gives zero values"
74
- done
75
-}
76
-
77
-sensors_check_temp_type() {
78
- # valid temp types are 1 to 6
79
- # disabled sensors have the value 0
80
-
81
- local f t v
82
- for f in "$@"; do
83
- # shellcheck disable=SC2001
84
- t=$(echo "$f" | sed "s|_input$|_type|g")
85
- [ "$f" = "$t" ] && echo "$f" && continue
86
- [ ! -f "$t" ] && echo "$f" && continue
87
-
88
- v="$(cat "$t")"
89
- v=$((v + 1 - 1))
90
- [ $v -ne 0 ] && echo "$f" && continue
91
-
92
- error "$f is disabled"
93
- done
94
-}
95
-
96
-# _create is called once, to create the charts
97
-sensors_create() {
98
- local path dir name x file lfile labelname device subsystem id type mode files multiplier divisor
99
-
100
- # we create a script with the source of the
101
- # sensors_update() function
102
- # - the highest speed we can achieve -
103
- [ $sensors_source_update -eq 1 ] && echo >"$TMP_DIR/sensors.sh" "sensors_update() {"
104
-
105
- for path in $(sensors_find_all_dirs "$sensors_sys_dir" | sort -u); do
106
- dir=$(basename "$path")
107
- device=
108
- subsystem=
109
- id=
110
- type=
111
- name=
112
-
113
- [ -h "$path/device" ] && device=$(readlink -f "$path/device")
114
- [ ! -z "$device" ] && device=$(basename "$device")
115
- [ -z "$device" ] && device="$dir"
116
-
117
- [ -h "$path/subsystem" ] && subsystem=$(readlink -f "$path/subsystem")
118
- [ ! -z "$subsystem" ] && subsystem=$(basename "$subsystem")
119
- [ -z "$subsystem" ] && subsystem="$dir"
120
-
121
- [ -f "$path/name" ] && name=$(cat "$path/name")
122
- [ -z "$name" ] && name="$dir"
123
-
124
- [ -f "$path/type" ] && type=$(cat "$path/type")
125
- [ -z "$type" ] && type="$dir"
126
-
127
- id="$(fixid "$device.$subsystem.$dir")"
128
-
129
- debug "path='$path', dir='$dir', device='$device', subsystem='$subsystem', id='$id', name='$name'"
130
-
131
- for mode in temperature voltage fans power current energy humidity; do
132
- files=
133
- multiplier=1
134
- divisor=1
135
- algorithm="absolute"
136
-
137
- case $mode in
138
- temperature)
139
- files="$(
140
- ls "$path"/temp*_input 2>/dev/null
141
- ls "$path/temp" 2>/dev/null
142
- )"
143
- files="$(sensors_check_files "$files")"
144
- files="$(sensors_check_temp_type "$files")"
145
- [ -z "$files" ] && continue
146
- echo "CHART 'sensors.temp_${id}_${name}' '' 'Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every '' '' 'sensors'"
147
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.temp_${id}_${name}' \$1\""
148
- divisor=1000
149
- ;;
150
-
151
- voltage)
152
- files="$(ls "$path"/in*_input 2>/dev/null)"
153
- files="$(sensors_check_files "$files")"
154
- [ -z "$files" ] && continue
155
- echo "CHART 'sensors.volt_${id}_${name}' '' 'Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every '' '' 'sensors'"
156
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.volt_${id}_${name}' \$1\""
157
- divisor=1000
158
- ;;
159
-
160
- current)
161
- files="$(ls "$path"/curr*_input 2>/dev/null)"
162
- files="$(sensors_check_files "$files")"
163
- [ -z "$files" ] && continue
164
- echo "CHART 'sensors.curr_${id}_${name}' '' 'Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every '' '' 'sensors'"
165
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.curr_${id}_${name}' \$1\""
166
- divisor=1000
167
- ;;
168
-
169
- power)
170
- files="$(ls "$path"/power*_input 2>/dev/null)"
171
- files="$(sensors_check_files "$files")"
172
- [ -z "$files" ] && continue
173
- echo "CHART 'sensors.power_${id}_${name}' '' 'Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every '' '' 'sensors'"
174
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.power_${id}_${name}' \$1\""
175
- divisor=1000000
176
- ;;
177
-
178
- fans)
179
- files="$(ls "$path"/fan*_input 2>/dev/null)"
180
- files="$(sensors_check_files "$files")"
181
- [ -z "$files" ] && continue
182
- echo "CHART 'sensors.fan_${id}_${name}' '' 'Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every '' '' 'sensors'"
183
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.fan_${id}_${name}' \$1\""
184
- ;;
185
-
186
- energy)
187
- files="$(ls "$path"/energy*_input 2>/dev/null)"
188
- files="$(sensors_check_files "$files")"
189
- [ -z "$files" ] && continue
190
- echo "CHART 'sensors.energy_${id}_${name}' '' 'Energy' 'Joule' 'energy' 'sensors.energy' area $((sensors_priority + 6)) $sensors_update_every '' '' 'sensors'"
191
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.energy_${id}_${name}' \$1\""
192
- algorithm="incremental"
193
- divisor=1000000
194
- ;;
195
-
196
- humidity)
197
- files="$(ls "$path"/humidity*_input 2>/dev/null)"
198
- files="$(sensors_check_files "$files")"
199
- [ -z "$files" ] && continue
200
- echo "CHART 'sensors.humidity_${id}_${name}' '' 'Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every '' '' 'sensors'"
201
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.humidity_${id}_${name}' \$1\""
202
- divisor=1000
203
- ;;
204
-
205
- *)
206
- continue
207
- ;;
208
- esac
209
-
210
- for x in $files; do
211
- file="$x"
212
- fid="$(fixid "$file")"
213
- lfile="$(basename "$file" | sed "s|_input$|_label|g")"
214
- labelname="$(basename "$file" | sed "s|_input$||g")"
215
-
216
- if [ ! "$path/$lfile" = "$file" ] && [ -f "$path/$lfile" ]; then
217
- labelname="$(cat "$path/$lfile")"
218
- fi
219
-
220
- echo "DIMENSION $fid '$labelname' $algorithm $multiplier $divisor"
221
- echo >>"$TMP_DIR/sensors.sh" "echo \"SET $fid = \"\$(< $file )"
222
- done
223
-
224
- echo >>"$TMP_DIR/sensors.sh" "echo END"
225
- done
226
- done
227
-
228
- [ $sensors_source_update -eq 1 ] && echo >>"$TMP_DIR/sensors.sh" "}"
229
-
230
- # ok, load the function sensors_update() we created
231
- # shellcheck source=/dev/null
232
- [ $sensors_source_update -eq 1 ] && . "$TMP_DIR/sensors.sh"
233
-
234
- return 0
235
-}
236
-
237
-# _update is called continuously, to collect the values
238
-sensors_update() {
239
- # the first argument to this function is the microseconds since last update
240
- # pass this parameter to the BEGIN statement (see below).
241
-
242
- # do all the work to collect / calculate the values
243
- # for each dimension
244
- # remember: KEEP IT SIMPLE AND SHORT
245
-
246
- # shellcheck source=/dev/null
247
- [ $sensors_source_update -eq 0 ] && . "$TMP_DIR/sensors.sh" "$1"
248
-
249
- return 0
250
-}
src/collectors/charts.d.plugin/sensors/sensors.conf
deleted
-32
@@ -1,32 +0,0 @@
1
-# no need for shebang - this file is loaded from charts.d.plugin
2
-
3
-# netdata
4
-# real-time performance and health monitoring, done right!
5
-# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
6
-# GPL v3+
7
-
8
-# THIS PLUGIN IS DEPRECATED
9
-# USE THE PYTHON.D ONE
10
-
11
-# the directory the kernel keeps sensor data
12
-#sensors_sys_dir="/sys/devices"
13
-
14
-# how deep in the tree to check for sensor data
15
-#sensors_sys_depth=10
16
-
17
-# if set to 1, the script will overwrite internal
18
-# script functions with code generated ones
19
-# leave to 1, is faster
20
-#sensors_source_update=1
21
-
22
-# the data collection frequency
23
-# if unset, will inherit the netdata update frequency
24
-#sensors_update_every=
25
-
26
-# the charts priority on the dashboard
27
-#sensors_priority=90000
28
-
29
-# the number of retries to do in case of failure
30
-# before disabling the module
31
-#sensors_retries=10
32
-