From anonymous, 3 Weeks ago, written in Plain Text.
This paste will expire in 24 Minutes.
Embed
  1. $ cputemp
  2. cpu_temperature,cpu=cpu0 celsius=43.00
  3. cpu_temperature,cpu=cpu1 celsius=46.00
  4. cpu_temperature,cpu=cpu2 celsius=50.00
  5. cpu_temperature,cpu=cpu3 celsius=46.00
  6. cpu_temperature,cpu=cpu4 celsius=44.00
  7.  
  8.  
  9. $ cat /usr/local/bin/cputemp
  10. #!/bin/sh
  11. for thermal_zone in /sys/class/thermal/thermal_zone*
  12. do
  13.     cpu_id=${thermal_zone##*thermal_zone}
  14.     temp="$(echo $(cat $thermal_zone/temp)/1000 | bc -l | xargs printf '%.2f\n')"
  15.     echo "cpu_temperature,cpu=cpu${cpu_id} celsius=${temp}"
  16. done
  17.