Skip to content

Instantly share code, notes, and snippets.

View lukasmalkmus's full-sized avatar
🏠
Working from home

Lukas Malkmus lukasmalkmus

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lukasmalkmus on github.
  • I am lukasmalkmus (https://keybase.io/lukasmalkmus) on keybase.
  • I have a public key whose fingerprint is DEE9 93B9 1DC6 D286 B028 259F 9F38 3C58 39B2 8670

To claim this, I am signing this object:

@lukasmalkmus
lukasmalkmus / Node Exporter CPU Temperature for Raspberry PI using textfile collector
Last active October 1, 2020 04:41
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
import (
"reflect"
"testing"
)
// assert fails the test if the condition is false.
func assert(tb testing.TB, condition bool, msg string, v ...interface{}) {
tb.Helper()
if !condition {
tb.Fatalf("\033[31m "+msg+"\033[39m\n\n", v...)