Debug nvme temp

This commit is contained in:
2025-03-03 20:28:22 -05:00
parent 05e86f9204
commit 6c7e8b8fe4

View File

@ -840,14 +840,20 @@ class SystemHealthMonitor:
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
text=True text=True
) )
logger.debug(f"NVMe smart-log raw output for {device}:")
logger.debug(nvme_result.stdout)
for line in nvme_result.stdout.split('\n'): for line in nvme_result.stdout.split('\n'):
if 'temperature' in line.lower(): if 'temperature' in line.lower():
# Extract only the numeric temperature value
temp_str = line.split(':')[1].strip() temp_str = line.split(':')[1].strip()
temp_value = int(''.join(c for c in temp_str if c.isdigit())[0:2]) logger.debug(f"Raw temperature string: {temp_str}")
smart_health['temp'] = temp_value
temp_value = int(''.join(c for c in temp_str if c.isdigit())[0:2])
logger.debug(f"Parsed temperature value: {temp_value}")
smart_health['temp'] = temp_value
logger.debug(f"Final temperature recorded: {smart_health['temp']}")
# Update temperature thresholds
if temp_value >= SMART_THRESHOLDS['Temperature_Celsius']['critical']: if temp_value >= SMART_THRESHOLDS['Temperature_Celsius']['critical']:
smart_health['severity'] = 'CRITICAL' smart_health['severity'] = 'CRITICAL'
smart_health['issues'].append(f"Critical temperature: {temp_value}°C") smart_health['issues'].append(f"Critical temperature: {temp_value}°C")