Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lukasmalkmus/410232035c3e831cb780347e77ae5382 to your computer and use it in GitHub Desktop.
Save lukasmalkmus/410232035c3e831cb780347e77ae5382 to your computer and use it in GitHub Desktop.
Add this single line to your crontab and enable the textfile collector. Collects the temperature of the CPU in degree celsius.
# crontab -e
* * * * * /opt/vc/bin/vcgencmd measure_temp | awk -F"=" '{print $2}' | awk -F"'" '{print "node_cpu_temperature " $1}' > /var/lib/node_exporter/textfile_collector/cpu_temp.prom.$$ && mv /var/lib/node_exporter/textfile_collector/cpu_temp.prom.$$ /var/lib/node_exporter/textfile_collector/cpu_temp.prom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment