Corrected comments. Added additional check

This commit is contained in:
Holger Obermaier 2022-08-10 17:00:47 +02:00
parent 8ba33568a6
commit 6eb8e3a1f5

View File

@ -101,7 +101,7 @@ func (r *RedfishReceiver) Start() {
break break
} }
// Skip all temperatures which ar not in enabled state // Skip all temperatures which are not in enabled state
if temperature.Status.State != common.EnabledState { if temperature.Status.State != common.EnabledState {
continue continue
} }
@ -119,8 +119,8 @@ func (r *RedfishReceiver) Start() {
// services supporting Redfish v1.6 or higher, this value shall be the // services supporting Redfish v1.6 or higher, this value shall be the
// zero-based array index. // zero-based array index.
"temperature_member_id": temperature.MemberID, "temperature_member_id": temperature.MemberID,
// PhysicalContext shall be a description of the affected device(s) or region // PhysicalContext shall be a description of the affected device or region
// within the chassis to which this power control applies. // within the chassis to which this temperature measurement applies
"temperature_physical_context": string(temperature.PhysicalContext), "temperature_physical_context": string(temperature.PhysicalContext),
// Name // Name
"temperature_name": temperature.Name, "temperature_name": temperature.Name,
@ -159,7 +159,7 @@ func (r *RedfishReceiver) Start() {
break break
} }
// Skip all fans which ar not in enabled state // Skip all fans which are not in enabled state
if fan.Status.State != common.EnabledState { if fan.Status.State != common.EnabledState {
continue continue
} }
@ -177,8 +177,8 @@ func (r *RedfishReceiver) Start() {
// services supporting Redfish v1.6 or higher, this value shall be the // services supporting Redfish v1.6 or higher, this value shall be the
// zero-based array index. // zero-based array index.
"fan_member_id": fan.MemberID, "fan_member_id": fan.MemberID,
// PhysicalContext shall be a description of the affected device(s) or region // PhysicalContext shall be a description of the affected device or region
// within the chassis to which this power control applies. // within the chassis to which this fan is associated
"fan_physical_context": string(fan.PhysicalContext), "fan_physical_context": string(fan.PhysicalContext),
// Name // Name
"fan_name": fan.Name, "fan_name": fan.Name,
@ -198,7 +198,7 @@ func (r *RedfishReceiver) Start() {
"unit": string(fan.ReadingUnits), "unit": string(fan.ReadingUnits),
} }
// ReadingCelsius shall be the current value of the temperature sensor's reading. // Reading shall be the current value of the fan sensor's reading
value := fan.Reading value := fan.Reading
y, err := lp.New("fan_speed", tags, meta, y, err := lp.New("fan_speed", tags, meta,
@ -239,6 +239,11 @@ func (r *RedfishReceiver) Start() {
// Read min, max and average consumed watts for each power control // Read min, max and average consumed watts for each power control
for _, pc := range power.PowerControl { for _, pc := range power.PowerControl {
// Skip all power controls which are not in enabled state
if pc.Status.State != common.EnabledState {
continue
}
// Map of collected metrics // Map of collected metrics
metrics := make(map[string]float32) metrics := make(map[string]float32)