Last active
August 27, 2020 07:03
-
-
Save droM4X/8cbeb9438bbc940ec25381f181f54208 to your computer and use it in GitHub Desktop.
Collectd - Raspberry Pi 3/4 CPU temperature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOSTNAME=${COLLECTD_HOSTNAME:-rpi}; | |
INTERVAL=${COLLECTD_INTERVAL:-30}; | |
while sleep "$INTERVAL" | |
do | |
cpuraw=$(</sys/class/thermal/thermal_zone0/temp) | |
cputemp=$(bc -l <<< "scale=2; ${cpuraw}/1000") | |
echo "PUTVAL \"$HOSTNAME/exec-temp/temperature-cpu\" interval=$INTERVAL N:$cputemp" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment