Log the RaspberryPi temperature to InfluxDB
#!/bin/bash | |
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp) | |
cpuTemp1=$(($cpuTemp0/1000)) | |
cpuTemp2=$(($cpuTemp0/100)) | |
cpuTempM=$(($cpuTemp2 % $cpuTemp1)) | |
serial=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2) | |
host="localhost:8086" | |
db="rpi" | |
curl -i -XPOST "http://${host}/write?db=${db}" --data-binary "cpu_temp,serial=${serial} temperature=${cpuTemp1}.${cpuTempM}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment