Skip to content

Instantly share code, notes, and snippets.

@pgmot
Created July 14, 2017 16:21
Show Gist options
  • 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