summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2021-03-13 08:36:48 +0100
committernicolargo <nicolas@nicolargo.com>2021-03-13 08:36:48 +0100
commit871b4c32b22581242c326b67459c2a86f97c6c4a (patch)
treebe7a90b15565a0e9cfcf60b161f69c6c62571e05
parentd201e647aa4995231b32e6bb39d16f8c8ce95d23 (diff)
Reaplly the Add hide option to sensors plugin #1596 PR
-rw-r--r--conf/glances.conf7
-rw-r--r--glances/plugins/glances_sensors.py12
2 files changed, 12 insertions, 7 deletions
diff --git a/conf/glances.conf b/conf/glances.conf
index 47481e3c..d7c7d87a 100644
--- a/conf/glances.conf
+++ b/conf/glances.conf
@@ -230,9 +230,10 @@ host=127.0.0.1
port=7634
[sensors]
-# This plugin is disable by default because on some system, the PsUtil
-# consume a lot of CPU to grab the stats...
-disable=True
+# Documentation: https://glances.readthedocs.io/en/latest/aoa/sensors.html
+disable=False
+# Hide some sensors
+#hide=ambient
# Sensors core thresholds (in Celsius...)
# Default values if not defined: 60/70/80
temperature_core_careful=60
diff --git a/glances/plugins/glances_sensors.py b/glances/plugins/glances_sensors.py
index 4917de7b..03f0beed 100644
--- a/glances/plugins/glances_sensors.py
+++ b/glances/plugins/glances_sensors.py
@@ -127,14 +127,18 @@ class Plugin(GlancesPlugin):
pass
- # Set the alias for each stat
+ # Global change on stats
+ self.stats = self.get_init_value()
for stat in stats:
+ # Do not take hide stat into account
+ if self.is_hide(stat["label"].lower()):
+ continue
+ # Set the alias for each stat
alias = self.has_alias(stat["label"].lower())
if alias:
stat["label"] = alias
-
- # Update the stats
- self.stats = stats
+ # Update the stats
+ self.stats.append(stat)
return self.stats