mirror of
https://codeberg.org/privacy1st/de-p1st-monitor
synced 2024-11-21 19:33:18 +01:00
v0.10.6
This commit is contained in:
parent
1997e35ed3
commit
be10017165
@ -3,7 +3,7 @@
|
||||
|
||||
[metadata]
|
||||
name = de.p1st.monitor
|
||||
version = 0.10.5
|
||||
version = 0.10.6
|
||||
author = Daniel Langbein
|
||||
author_email = daniel@systemli.org
|
||||
description = periodically monitor and warn
|
||||
|
@ -150,4 +150,10 @@ class DriveLogger(Logger):
|
||||
raise LoggerReadEx(f'smartctl failed with returncode {returncode}\nstdout: {stdout}\nstderr: {stderr}')
|
||||
j = json.loads(stdout)
|
||||
|
||||
return j['temperature']['current']
|
||||
temp_key = 'temperature'
|
||||
if temp_key not in j:
|
||||
raise LoggerReadEx(f'smartctl JSON does not contain key {temp_key}. {device}')
|
||||
current_key = 'current'
|
||||
if current_key not in j[temp_key]:
|
||||
raise LoggerReadEx(f'smartctl JSON does not contain key {temp_key}.{current_key}. {device}')
|
||||
return j[temp_key][current_key]
|
||||
|
Loading…
Reference in New Issue
Block a user