From 15c036f32110eddc98917419a08b7bfe5bd00395 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Thu, 17 Oct 2019 20:53:14 -0400 Subject: [PATCH] Separate hardware monitor power and thermal senser data The redfish thermal sensor data output clobbers the power sensor data. This update directs the thermal and power sensor readouts into two separate files so they are preserved for off box analysis and continued support for sensor_data product verification testing. Removed unused procedure that did not support two sensor data output files. Test Plan: PASS: Verify system install PASS: Verify power and sensor monitoring. PASS: Verify power fault insertion testing PASS: Verify thermal fault insertion testing Change-Id: Ie7717728944e93dd6fcc38a2c971189764276929 Story: 2005861 Task: 37203 Signed-off-by: Eric MacDonald --- mtce-common/src/common/bmcUtil.h | 2 ++ mtce/src/hwmon/hwmonClass.cpp | 28 ---------------------------- mtce/src/hwmon/hwmonClass.h | 1 - mtce/src/hwmon/hwmonHdlr.cpp | 5 ----- mtce/src/hwmon/hwmonThreads.cpp | 4 ++-- 5 files changed, 4 insertions(+), 36 deletions(-) diff --git a/mtce-common/src/common/bmcUtil.h b/mtce-common/src/common/bmcUtil.h index a7b6b17d..d7e49e63 100644 --- a/mtce-common/src/common/bmcUtil.h +++ b/mtce-common/src/common/bmcUtil.h @@ -98,6 +98,8 @@ typedef enum #define BMC_RESTART_CAUSE_FILE_SUFFIX ((const char *)("_restart_cause")) #define BMC_POWER_STATUS_FILE_SUFFIX ((const char *)("_power_status")) #define BMC_SENSOR_OUTPUT_FILE_SUFFIX ((const char *)("_sensor_data")) +#define BMC_POWER_SENSOR_FILE_SUFFIX ((const char *)("_power_sensor_data")) +#define BMC_THERMAL_SENSOR_FILE_SUFFIX ((const char *)("_thermal_sensor_data")) #define BMC_POWER_ON_STATUS ((const char *)("on")) #define BMC_POWER_OFF_STATUS ((const char *)("off")) diff --git a/mtce/src/hwmon/hwmonClass.cpp b/mtce/src/hwmon/hwmonClass.cpp index 2cda37f2..1d856a79 100644 --- a/mtce/src/hwmon/hwmonClass.cpp +++ b/mtce/src/hwmon/hwmonClass.cpp @@ -2184,34 +2184,6 @@ void hwmonHostClass::modify_audit_interval ( string hostname , int interval ) } } - -/* log sensor data to a tmp file to assis debug of sensor read issues */ -void hwmonHostClass::log_sensor_data ( struct hwmonHostClass::hwmon_host * host_ptr, string & sensorname, string from, string to ) -{ - string sensor_datafile = IPMITOOL_OUTPUT_DIR ; - sensor_datafile.append(host_ptr->hostname); - sensor_datafile.append(BMC_SENSOR_OUTPUT_FILE_SUFFIX); - - string debugfile = "/tmp/" ; - debugfile.append(host_ptr->hostname); - debugfile.append(BMC_SENSOR_OUTPUT_FILE_SUFFIX); - debugfile.append("_debug"); - - string source = pt() ; - source.append (" - "); - source.append (sensorname); - source.append (" from '"); - source.append (from ); - source.append ("' to '"); - source.append (to ); - source.append ("'\n"); - daemon_log ( debugfile.data(), source.data()); - daemon_log ( debugfile.data(), host_ptr->bmc_thread_info.data.data()); - daemon_log ( debugfile.data(), daemon_read_file ( sensor_datafile.data()).data()); - daemon_log ( debugfile.data(), "---------------------------------------------------------------------\n"); -} - - void hwmonHostClass::print_node_info ( void ) { fflush (stdout); diff --git a/mtce/src/hwmon/hwmonClass.h b/mtce/src/hwmon/hwmonClass.h index 7a25caf5..ea5efecb 100644 --- a/mtce/src/hwmon/hwmonClass.h +++ b/mtce/src/hwmon/hwmonClass.h @@ -283,7 +283,6 @@ class hwmonHostClass /** handled deleting a host from the hwmonHostClass object */ int delete_handler ( struct hwmonHostClass::hwmon_host * host_ptr ); - void log_sensor_data ( struct hwmonHostClass::hwmon_host * host_ptr, string & sensorname, string data, string note); void mem_log_info ( struct hwmonHostClass::hwmon_host * host_ptr ); void mem_log_options ( struct hwmonHostClass::hwmon_host * host_ptr ); void mem_log_bm ( struct hwmonHostClass::hwmon_host * host_ptr ); diff --git a/mtce/src/hwmon/hwmonHdlr.cpp b/mtce/src/hwmon/hwmonHdlr.cpp index 1c481428..24b14066 100644 --- a/mtce/src/hwmon/hwmonHdlr.cpp +++ b/mtce/src/hwmon/hwmonHdlr.cpp @@ -1640,11 +1640,6 @@ int hwmonHostClass::bmc_sensor_monitor ( struct hwmonHostClass::hwmon_host * hos get_severity(ptr->severity).c_str(), ptr->status.c_str(), get_severity(severity).c_str()); - - /* debounce of the transient 'na' case is debounced - * if ( host_ptr->sensor_query_count > 5 ) - * log_sensor_data ( host_ptr, ptr->sensorname, ptr->status, get_bmc_severity(ptr->sample_severity)); - */ } blog1 ("%s %s curr:%s this:%s last:%s\n", diff --git a/mtce/src/hwmon/hwmonThreads.cpp b/mtce/src/hwmon/hwmonThreads.cpp index 21c07544..babc8330 100644 --- a/mtce/src/hwmon/hwmonThreads.cpp +++ b/mtce/src/hwmon/hwmonThreads.cpp @@ -1205,7 +1205,7 @@ void * hwmonThread_redfish ( void * arg ) { blog2_t ("%s read power sensors \n", info_ptr->log_prefix); if ( _redfishUtil_send_request( info_ptr, datafile, - BMC_SENSOR_OUTPUT_FILE_SUFFIX, + BMC_POWER_SENSOR_FILE_SUFFIX, REDFISHTOOL_READ_POWER_SENSORS_CMD ) == PASS ) { /* look for the output data file */ @@ -1222,7 +1222,7 @@ void * hwmonThread_redfish ( void * arg ) blog2_t ("%s read thermal sensors \n", info_ptr->log_prefix); if (_redfishUtil_send_request( info_ptr, datafile, - BMC_SENSOR_OUTPUT_FILE_SUFFIX, + BMC_THERMAL_SENSOR_FILE_SUFFIX, REDFISHTOOL_READ_THERMAL_SENSORS_CMD ) == PASS ) { /* look for the output data file */