From 60ef0ed1167f5d41adbe205468279085fe4d1735 Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:37:24 +0200 Subject: [PATCH] Fix for servers, which do not set status.state for thermals or powercontrols --- receivers/redfishReceiver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/receivers/redfishReceiver.go b/receivers/redfishReceiver.go index 20fa0c7..71fb93d 100644 --- a/receivers/redfishReceiver.go +++ b/receivers/redfishReceiver.go @@ -78,7 +78,7 @@ func (r *RedfishReceiver) readThermalMetrics( } // Skip all temperatures which are not in enabled state - if temperature.Status.State != common.EnabledState { + if temperature.Status.State != "" && temperature.Status.State != common.EnabledState { continue } @@ -212,7 +212,7 @@ func (r *RedfishReceiver) readPowerMetrics( for _, pc := range power.PowerControl { // Skip all power controls which are not in enabled state - if pc.Status.State != common.EnabledState { + if pc.Status.State != "" && pc.Status.State != common.EnabledState { continue }