Simple phone alerts with Gmail and Android
I have some long running server processes that I am going to launch soonish, and I want to be alerted when they're done. Using Gmail and Android, it's pretty easy:
- In Gmail, set up a new label, "Alerts" or something like that.
- Set up a filter in Gmail that matches messages along the lines of firstname.lastname@example.org, and adds the Alerts label, does not skip the inbox and are always marked as important.
- Now, on your Android phone, in Gmail -> Settings -> Account settings (select the account) -> Sync inboxes and labels, and select your Alerts label.
- Then, go back and select Labels to Notify in settings, select "Alerts", and add it to "Notify in Status bar", select an appropriate ringtone, set vibrate to 'always', and deselect 'Notify once' - because we want to be notified any time an alert comes in.
That should do it - on your server, set up an alias in something like /etc/aliases that redirects email from the alert alias - codered in this case - to your own email address.
Now, you can script alerts that will get their own ringtone on your phone like so: echo "Dave, I can't let you do that" | mail -s "Warning, computer malfunction" email@example.com
Pretty simple and effective if you need a simple way for your computer to let you know that it needs attention right now.