summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/sensors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
commit1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch)
tree8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /collectors/python.d.plugin/sensors
parentUpdate watch file (diff)
downloadnetdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz
netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--collectors/python.d.plugin/sensors/Makefile.inc13
-rw-r--r--collectors/python.d.plugin/sensors/README.md17
-rw-r--r--collectors/python.d.plugin/sensors/sensors.chart.py (renamed from python.d/sensors.chart.py)29
-rw-r--r--collectors/python.d.plugin/sensors/sensors.conf (renamed from conf.d/python.d/sensors.conf)0
4 files changed, 48 insertions, 11 deletions
diff --git a/collectors/python.d.plugin/sensors/Makefile.inc b/collectors/python.d.plugin/sensors/Makefile.inc
new file mode 100644
index 000000000..5fb26e1c8
--- /dev/null
+++ b/collectors/python.d.plugin/sensors/Makefile.inc
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# THIS IS NOT A COMPLETE Makefile
+# IT IS INCLUDED BY ITS PARENT'S Makefile.am
+# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
+
+# install these files
+dist_python_DATA += sensors/sensors.chart.py
+dist_pythonconfig_DATA += sensors/sensors.conf
+
+# do not install these files, but include them in the distribution
+dist_noinst_DATA += sensors/README.md sensors/Makefile.inc
+
diff --git a/collectors/python.d.plugin/sensors/README.md b/collectors/python.d.plugin/sensors/README.md
new file mode 100644
index 000000000..eb1642d90
--- /dev/null
+++ b/collectors/python.d.plugin/sensors/README.md
@@ -0,0 +1,17 @@
+# sensors
+
+System sensors information.
+
+Charts are created dynamically.
+
+### configuration
+
+For detailed configuration information please read [`sensors.conf`](sensors.conf) file.
+
+### possible issues
+
+There have been reports from users that on certain servers, ACPI ring buffer errors are printed by the kernel (`dmesg`) when ACPI sensors are being accessed.
+We are tracking such cases in issue [#827](https://github.com/netdata/netdata/issues/827).
+Please join this discussion for help.
+
+---
diff --git a/python.d/sensors.chart.py b/collectors/python.d.plugin/sensors/sensors.chart.py
index 06e420b68..69d2bfe99 100644
--- a/python.d/sensors.chart.py
+++ b/collectors/python.d.plugin/sensors/sensors.chart.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Description: sensors netdata python.d plugin
# Author: Pawel Krupa (paulfantom)
+# SPDX-License-Identifier: GPL-3.0-or-later
from bases.FrameworkServices.SimpleService import SimpleService
from third_party import lm_sensors as sensors
@@ -16,37 +17,44 @@ CHARTS = {
'options': [None, ' temperature', 'Celsius', 'temperature', 'sensors.temperature', 'line'],
'lines': [
[None, None, 'absolute', 1, 1000]
- ]},
+ ]
+ },
'voltage': {
'options': [None, ' voltage', 'Volts', 'voltage', 'sensors.voltage', 'line'],
'lines': [
[None, None, 'absolute', 1, 1000]
- ]},
+ ]
+ },
'current': {
'options': [None, ' current', 'Ampere', 'current', 'sensors.current', 'line'],
'lines': [
[None, None, 'absolute', 1, 1000]
- ]},
+ ]
+ },
'power': {
'options': [None, ' power', 'Watt', 'power', 'sensors.power', 'line'],
'lines': [
[None, None, 'absolute', 1, 1000000]
- ]},
+ ]
+ },
'fan': {
'options': [None, ' fans speed', 'Rotations/min', 'fans', 'sensors.fan', 'line'],
'lines': [
[None, None, 'absolute', 1, 1000]
- ]},
+ ]
+ },
'energy': {
'options': [None, ' energy', 'Joule', 'energy', 'sensors.energy', 'areastack'],
'lines': [
[None, None, 'incremental', 1, 1000000]
- ]},
+ ]
+ },
'humidity': {
'options': [None, ' humidity', 'Percent', 'humidity', 'sensors.humidity', 'line'],
'lines': [
[None, None, 'absolute', 1, 1000]
- ]}
+ ]
+ }
}
LIMITS = {
@@ -94,7 +102,7 @@ class Service(SimpleService):
limit = LIMITS[type_name]
if val < limit[0] or val > limit[1]:
continue
- data[prefix + "_" + str(feature.name.decode())] = int(val * 1000)
+ data[prefix + '_' + str(feature.name.decode())] = int(val * 1000)
except Exception as error:
self.error(error)
return None
@@ -114,7 +122,7 @@ class Service(SimpleService):
continue
if TYPE_MAP[feature.type] == sensor:
# create chart
- name = chip_name + "_" + TYPE_MAP[feature.type]
+ name = chip_name + '_' + TYPE_MAP[feature.type]
if name not in self.order:
self.order.append(name)
chart_def = list(CHARTS[sensor]['options'])
@@ -122,7 +130,7 @@ class Service(SimpleService):
self.definitions[name] = {'options': chart_def}
self.definitions[name]['lines'] = []
line = list(CHARTS[sensor]['lines'][0])
- line[0] = chip_name + "_" + str(feature.name.decode())
+ line[0] = chip_name + '_' + str(feature.name.decode())
line[1] = sensors.get_label(chip, feature)
self.definitions[name]['lines'].append(line)
@@ -136,4 +144,3 @@ class Service(SimpleService):
self.create_definitions()
return True
-
diff --git a/conf.d/python.d/sensors.conf b/collectors/python.d.plugin/sensors/sensors.conf
index 83bbffd7d..83bbffd7d 100644
--- a/conf.d/python.d/sensors.conf
+++ b/collectors/python.d.plugin/sensors/sensors.conf