Skip to content

Instantly share code, notes, and snippets.

@pgmot
Created July 14, 2017 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgmot/a523de50ed1358747a30a5e2a256e362 to your computer and use it in GitHub Desktop.
Save pgmot/a523de50ed1358747a30a5e2a256e362 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ref: https://github.com/ymyzk/mackerel-plugins/blob/master/raspberrypi/temp.sh
SECONDS=`date '+%s'`
NAME='temperature.cpu'
TEMP=`cat /sys/class/thermal/thermal_zone0/temp`
VALUE=`echo "scale=3; ${TEMP} / 1000" | bc`
echo -e "${NAME}\t${VALUE}\t${SECONDS}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment