Debug nvme temp
This commit is contained in:
@ -840,14 +840,20 @@ class SystemHealthMonitor:
|
||||
stderr=subprocess.PIPE,
|
||||
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'):
|
||||
if 'temperature' in line.lower():
|
||||
# Extract only the numeric temperature value
|
||||
temp_str = line.split(':')[1].strip()
|
||||
temp_value = int(''.join(c for c in temp_str if c.isdigit())[0:2])
|
||||
smart_health['temp'] = temp_value
|
||||
logger.debug(f"Raw temperature string: {temp_str}")
|
||||
|
||||
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']:
|
||||
smart_health['severity'] = 'CRITICAL'
|
||||
smart_health['issues'].append(f"Critical temperature: {temp_value}°C")
|
||||
|
||||
Reference in New Issue
Block a user