From bfc2b65e99d95cbffa7dcfcfe72c52d4227da74d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 17 Oct 2017 11:07:54 -0400 Subject: [PATCH] Support 'energy' sensor category Energy is distinct from power, categorize it as such. --- confluent_client/bin/nodesensors | 1 + confluent_server/confluent/core.py | 4 ++++ confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodesensors b/confluent_client/bin/nodesensors index 60e69cac..58b1281b 100755 --- a/confluent_client/bin/nodesensors +++ b/confluent_client/bin/nodesensors @@ -36,6 +36,7 @@ import confluent.client as client sensorcollections = { 'all': 'sensors/hardware/all/all', + 'energy': 'sensors/hardware/energy/all', 'temperature': 'sensors/hardware/temperature/all', 'temp': 'sensors/hardware/temperature/all', 'power': 'sensors/hardware/power/all', diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index d6858ef9..2b523c9b 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -257,6 +257,10 @@ def _init_core(): 'pluginattrs': ['hardwaremanagement.method'], 'default': 'ipmi', }), + 'energy': PluginCollection({ + 'pluginattrs': ['hardwaremanagement.method'], + 'default': 'ipmi', + }), 'temperature': PluginCollection({ 'pluginattrs': ['hardwaremanagement.method'], 'default': 'ipmi', diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index eca4bbd0..b6e2e109 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -69,7 +69,8 @@ _ipmiwaiters = [] sensor_categories = { 'temperature': frozenset(['Temperature']), - 'power': frozenset(['Power', 'Current', 'Battery']), + 'energy': frozenset(['Energy']), + 'power': frozenset(['Power', 'Current']), 'fans': frozenset(['Fan', 'Cooling Device']), }