root / plugins / raspberry-pi / rpi_temp @ 17f78427
Historique | Voir | Annoter | Télécharger (501 octets)
| 1 | 6af19f55 | Steve Schnepp | #! /bin/sh |
|---|---|---|---|
| 2 | # (c) 2013 - LGPL - Steve Schnepp <steve.schnepp@pwkf.org> |
||
| 3 | |||
| 4 | |||
| 5 | if [ ! -r "/sys/class/thermal/thermal_zone0/temp" ] |
||
| 6 | then |
||
| 7 | echo "# Cannot read CPU Temp" |
||
| 8 | exit 1 |
||
| 9 | fi |
||
| 10 | |||
| 11 | |||
| 12 | if [ "$1" = "config" ] |
||
| 13 | then |
||
| 14 | cat <<EOF |
||
| 15 | graph_title CPU Temp |
||
| 16 | graph_category system |
||
| 17 | graph_vlabel C |
||
| 18 | thermal_zone0.label Current CPU Temp |
||
| 19 | EOF |
||
| 20 | exit 0 |
||
| 21 | fi |
||
| 22 | |||
| 23 | # values |
||
| 24 | TEMP_MILLI_C=$(cat /sys/class/thermal/thermal_zone0/temp) |
||
| 25 | |||
| 26 | f360f189 | Lars Kruse | echo "thermal_zone0.value $(echo "$TEMP_MILLI_C" | awk '{printf("%0.3f", $1 / 1000)}')"
|
| 27 | 6af19f55 | Steve Schnepp | |
| 28 | exit 0 |
