fix: tolerate smc error from osx-cpu-temp

pull/405/head
Branch Vincent 2023-10-15 12:04:39 -07:00
parent ac0f6660be
commit 5634526721
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -3225,7 +3225,7 @@ class CpuCollector(Collector):
cls.cpu_temp_high = 85
cls.cpu_temp_crit = 100
elif cls.sensor_method == "osx-cpu-temp":
temp = max(0, round(float(subprocess.check_output("osx-cpu-temp", universal_newlines=True).strip()[:-2])))
temp = max(0, round(float(subprocess.check_output("osx-cpu-temp", universal_newlines=True).splitlines()[-1].strip()[:-2])))
if not cls.cpu_temp_high:
cls.cpu_temp_high = 85
cls.cpu_temp_crit = 100