@@ -94,18 +94,17 @@ def check_memory():
|
|||||||
|
|
||||||
|
|
||||||
def check_rpi_power_status():
|
def check_rpi_power_status():
|
||||||
full_cmd = "vcgencmd get_throttled | awk -F= '{print $2}'"
|
try:
|
||||||
power_status = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
|
full_cmd = "vcgencmd get_throttled | cut -d= -f2"
|
||||||
|
throttled = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
|
||||||
|
throttled = throttled.decode('utf-8').strip()
|
||||||
|
|
||||||
if power_status:
|
if throttled == "0x0":
|
||||||
if power_status == "0x0":
|
return "OK"
|
||||||
power_status = "OK"
|
|
||||||
else:
|
else:
|
||||||
power_status = "KO"
|
return "KO"
|
||||||
else:
|
except Exception as e:
|
||||||
power_status = "NA"
|
return "Error: " + str(e)
|
||||||
|
|
||||||
return power_status
|
|
||||||
|
|
||||||
|
|
||||||
def check_cpu_temp():
|
def check_cpu_temp():
|
||||||
|
|||||||
Reference in New Issue
Block a user