Litecoins Blog Automatic Email Notification for Mining Rig Startup or Reboot

Automatic Email Notification for Mining Rig Startup or Reboot 2

I decided that I wanted to find a way so that my Mining Rigs would email me whenever they started up as well as if the rigs were rebooted so I was aware that there may be a problem with them.

I decided to implement this solution. This solution is for Linux. All my rigs are running under XUbuntu.

Steps to setup Automatic Email Notification on Startup & Reboot

sudo apt-get install sendemail

cd /home/<your username>

vi emailme

Then copy in this script below replacing email addresses and email servers with your own.

#!/bin/sh
ifconfig | grep -Po “inet addr:.+Bcast” | grep -Po ‘(?:\d{1,3}\.){3}\d{1,3}’ > ‘/tmp/ip_address.txt’

echo ” Mining Rig Status” >> ‘/tmp/ip_address.txt’

sendEmail -f <Email Address this email will be sent from> -t <Destination Email Address> -u Mining Rig -o message-file=/tmp/ip_address.txt -v -s <Your SMTP Server>

Now lets add it to the startup so its called everytime your machine boots up ( but only once you have a network connection)

sudo mv emailme /etc/network/if-up.d/
sudo chmod +x /etc/network/if-up.d/

All Done

Now you will receive an email whenever your Mining Rig is started or Rebooted that includes the Servers IP Address for reference. I find this very useful for monitoring my Mining Rigs.

2 thoughts on “Automatic Email Notification for Mining Rig Startup or Reboot

  1. Reply mafia May 18,2013 3:24 pm

    Hello,

    Thank you for this great tutorial. Just to say that users also need to specify details for SMTP authentication, otherwise this script will not work. This is how is done:

    sendEmail -f -t -u Mining Rig -o message-file=/tmp/ip_address.txt -v -s smtp.live.com -xu -xp

  2. Reply litecoinsblog May 18,2013 4:46 pm

    You are absolutely right. If you have authentication on your smtp server you need to define your smtp servers login and password.

    In my case I own my own smtp server so authentication wasnt required.

Leave a Reply