diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index f70bc6ae..6ab6bd59 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -481,6 +481,20 @@ def _init_core(): 'pluginattrs': ['hardwaremanagement.method'], 'default': 'ipmi', }), + 'normalized': { + 'inlet_temp': PluginRoute({ + 'pluginattrs': ['hardwaremanagement.method'], + 'default': 'ipmi', + }), + 'average_cpu_temp': PluginRoute({ + 'pluginattrs': ['hardwaremanagement.method'], + 'default': 'ipmi', + }), + 'total_power': PluginRoute({ + 'pluginattrs': ['hardwaremanagement.method'], + 'default': 'ipmi', + }), + }, 'energy': 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 938b69ae..06a8c444 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -861,6 +861,23 @@ class IpmiHandler(object): resourcename = sensor['name'] self.ipmicmd.sensormap[simplify_name(resourcename)] = resourcename + def read_normalized(self, sensorname): + readings = None + if sensorname == 'average_cpu_temp': + cputemp = self.ipmicmd.get_average_processor_temperature() + readings = [cputemp] + elif sensorname == 'inlet_temp': + inltemp = self.ipmicmd.get_inlet_temperature() + readings = [inltemp] + elif sensorname == 'total_power': + sensor = EmptySensor('Total Power') + sensor.states = [] + sensor.units = 'W' + sensor.value = self.ipmicmd.get_system_power_watts() + readings = [sensor] + if readings: + self.output.put(msg.SensorReadings(readings, name=self.node)) + def read_sensors(self, sensorname): if sensorname == 'all': sensors = self.ipmicmd.get_sensor_descriptions() @@ -1157,6 +1174,8 @@ class IpmiHandler(object): if len(self.element) < 3: return self.sensorcategory = self.element[2] + if self.sensorcategory == 'normalized': + return self.read_normalized(self.element[-1]) # list sensors per category if len(self.element) == 3 and self.element[-2] == 'hardware': if self.sensorcategory == 'leds': diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index 20315134..f53cc393 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -712,6 +712,23 @@ class IpmiHandler(object): resourcename = sensor['name'] self.sensormap[simplify_name(resourcename)] = resourcename + def read_normalized(self, sensorname): + readings = None + if sensorname == 'average_cpu_temp': + cputemp = self.ipmicmd.get_average_processor_temperature() + readings = [cputemp] + elif sensorname == 'inlet_temp': + inltemp = self.ipmicmd.get_inlet_temperature() + readings = [inltemp] + elif sensorname == 'total_power': + sensor = EmptySensor('Total Power') + sensor.states = [] + sensor.units = 'W' + sensor.value = self.ipmicmd.get_system_power_watts() + readings = [sensor] + if readings: + self.output.put(msg.SensorReadings(readings, name=self.node)) + def read_sensors(self, sensorname): if sensorname == 'all': sensors = self.ipmicmd.get_sensor_descriptions() @@ -1012,6 +1029,8 @@ class IpmiHandler(object): if len(self.element) < 3: return self.sensorcategory = self.element[2] + if self.sensorcategory == 'normalized': + return self.read_normalized(self.element[-1]) # list sensors per category if len(self.element) == 3 and self.element[-2] == 'hardware': if self.sensorcategory == 'leds':