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:

  1. In Gmail, set up a new label, "Alerts" or something like that.
  2. Set up a filter in Gmail that matches messages along the lines of, and adds the Alerts label, does not skip the inbox and are always marked as important.
  3. Now, on your Android phone, in Gmail -> Settings -> Account settings (select the account) -> Sync inboxes and labels, and select your Alerts label.
  4. 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"

Pretty simple and effective if you need a simple way for your computer to let you know that it needs attention right now.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s