
gpu = commands.getoutput( '/opt/vc/bin/vcgencmd measure_temp' ).replace( 'temp=', '' ).replace( '\'C', '' ) |
print('gpu Temp: %.2f ' % gpu) |
file = open("/sys/class/thermal/thermal_zone0/temp") |
cpu = float(file.read()) / 1000 |
print('cpu Temp: %2.2f' % cpu) |
load_1min = str(os.popen("top -n1 | awk '/load average:/ {print $12}'").readline().strip()).replace(',', '' ) |
load_5min = str(os.popen("top -n1 | awk '/load average:/ {print $13}'").readline().strip()).replace(',', '' ) |
load_1min=float(load_1min) |
load_5min=float(load_5min) |
print('load_1min: %.2f'%load_1min) |
print('load_5min: %.2f'%load_5min) |
Ramused = str(os.popen("top -n1 | awk '/KiB/ {print $6}'").readline().strip()).replace(',', '' ) |
print('Ramused: %d '%Ramused +' Mb') |
return(line.split()[1:5]) |
DISK_stats = getDiskSpace() |
DISK_total = DISK_stats[0].replace('G','') |
DISK_used = DISK_stats[1].replace('G', '' ) |
DISK_perc = DISK_stats[3].replace('%', '' ) |
print('DISK_total: '+str(DISK_total)+' Gb') |
print('DISK_used: '+str(DISK_used)+' Gb') |
print('DISK_perc: '+str(DISK_perc)+' %') |
if __name__ == '__main__': |
main()
---------------------------------------------------------------------------------------------------------------------- 我们尊重原创,也注重分享,文章来源于微信公众号:墨烦信息,建议关注公众号查看原文。如若侵权请联系qter@qter.org。 ---------------------------------------------------------------------------------------------------------------------- |