Skip to content

Instantly share code, notes, and snippets.

@GregPK
Created September 26, 2013 08:28
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 GregPK/6711385 to your computer and use it in GitHub Desktop.
Save GregPK/6711385 to your computer and use it in GitHub Desktop.
Simple load and temperature monitor for my HTPC box. Originally used to measure efficiency of GPU drivers (integrated into the CPU) and the noise they make (fan speed)
#!/bin/bash
while [ true ]; do
echo -n `date '+%Y-%m-%d_%H:%M:%S'` ;
echo -n ' ';
awk '{print $1,$2,$3}' /proc/loadavg | tr -d '\n';
echo -n ' ';
sensors | grep fan1 | tr -d '\n' | awk '{printf $2}';
echo -n ' ';
sensors | grep temp1 -m 1 | tr -d '\n' | awk '{gsub(/[C°\+\^]/,"")}; {printf $2}';
echo -n ' ';
sensors | grep temp2 -m 1 | awk '{gsub(/[C°\+\^]/,"")}; {print $2}';
sleep 5;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment