From cc53f1e689356bddc5d4e96682851e495ba433c8 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Thu, 12 Jul 2018 10:05:00 -0400 Subject: [PATCH] Maintain sensor degrade over a process restart When the Hardware Monitor starts up it reads existing alarms and sensor state from the sysinv database. It then uses this pre-existing state to align its internal structure accordingly moving forward. The hardware monitor manage_startup_states utility is incorrectly requesting degrade clear rather than degrade set in response to finding a pre-existing critical sensor assertion on process startup. This update fixes this issue by calling the set_degraded_state rather than clear_degraded_state against this sensor in this case. Change-Id: Ic1ecc1f11d7a729c16da63c6d43b7d758bb9e467 Signed-off-by: David Sullivan Story: 2002882 Task: 22845 --- mtce-common/cgts-mtce-common-1.0/hwmon/hwmonHdlr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtce-common/cgts-mtce-common-1.0/hwmon/hwmonHdlr.cpp b/mtce-common/cgts-mtce-common-1.0/hwmon/hwmonHdlr.cpp index e4d41f54..95200451 100644 --- a/mtce-common/cgts-mtce-common-1.0/hwmon/hwmonHdlr.cpp +++ b/mtce-common/cgts-mtce-common-1.0/hwmon/hwmonHdlr.cpp @@ -2462,7 +2462,7 @@ bool hwmonHostClass::manage_startup_states ( struct hwmonHostClass::hwmon_host * else if ( critl == true ) { - clear_degraded_state ( sensor_ptr ); + set_degraded_state ( sensor_ptr ); set_alarmed_severity ( sensor_ptr, FM_ALARM_SEVERITY_CRITICAL); hwmonAlarm_critical ( host_ptr->hostname, HWMON_ALARM_ID__SENSOR, sensor_ptr->sensorname, REASON_DEGRADED ); }