Created
May 28, 2011 23:23
-
-
Save disq/997339 to your computer and use it in GitHub Desktop.
GPU Monitor to send mail when load drops to 0%
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RET=`DISPLAY=:0 aticonfig --odgc --adapter=all` | |
ZEROCNT=`echo ${RET}|grep GPU|grep "0%"|wc -l` | |
if [ $ZEROCNT -gt 0 ]; then | |
if [ -e ~/gpu-monitor.stop ]; then | |
echo "$ZEROCNT gpu still idle" | |
exit 0 | |
fi | |
sleep 10 | |
RET=`DISPLAY=:0 aticonfig --odgc --adapter=all` | |
ZEROCNT=`echo ${RET}|grep GPU|grep "0%"|wc -l` | |
if [ $ZEROCNT -gt 0 ]; then | |
echo "sound the alarm, $ZEROCNT gpu idle" | |
echo "`date` ${RET}" | sendemail -q -f from@gmail.com -t to@gmail.com -u "GPU idle" -s smtp.gmail.com:587 -o tls=auto -xu from@gmail.com -xp password-of-from-gmail | |
touch ~/gpu-monitor.stop && sync | |
exit 0 | |
fi | |
fi | |
echo "its ok" | |
if [ -e ~/gpu-monitor.stop ]; then | |
rm -f ~/gpu-monitor.stop && sync | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ZEROCNT=`find /tmp -name '5*txt' -mmin +1|wc -l` | |
if [ $ZEROCNT -gt 0 ]; then | |
if [ -e ~/hash-monitor.stop ]; then | |
echo "$ZEROCNT miners still idle" | |
else | |
echo "sound the alarm, $ZEROCNT miners idle" | |
echo "`date` ${ZEROCNT} miners are idle" | sendemail -q -f from@gmail.com -t to@gmail.com -u "GPU idle" -s smtp.gmail.com:587 -o tls=auto -xu from@gmail.com -xp password-of-from-gmail | |
touch ~/hash-monitor.stop && sync | |
fi | |
else | |
echo "its ok" | |
if [ -e ~/hash-monitor.stop ]; then | |
rm -f ~/hash-monitor.stop && sync | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment