Almost all cellphones and carriers support SMS’s now, and sms bundles of hundreds or unlimited plans are really cheap. One spiffy feature that most major carriers provide is email to SMS relaying. Below are some of the major carriers relaying addresses.
Alltel email@example.com AT&T Wireless / Cingular firstname.lastname@example.org Boost Mobile email@example.com Cingular firstname.lastname@example.org email@example.com Nextel firstname.lastname@example.org Sprint PCS email@example.com T-Mobile firstname.lastname@example.org Verizon email@example.com Virgin firstname.lastname@example.org
So if you want to send a SMS, send a email to the above email format. The from and the subject fields will be added to the message body. Check with your carrier about how long a message can be, usually it’s 160 characters (including the from, subject and body together). Now let’s make things fun.
Sendmail is nice. Most *nix installations will have it already configured, if not it’s not that hard to setup anyway. Sendmail allows you to send emails through the command line directly, for example you can pipe the message body into sendmail to be sent as the message body.
echo moo | sendmail email@example.com
Since SMS’s can now be represented by an email address, you can pipe the output of various commands directly into a SMS message. For example, one of the things I use this daily is to be alerted when builds finish that take a long time.
make something && echo "Make Finished" | sendmail firstname.lastname@example.org
I made it even simpler by writing a bash script named “sms”.
#!/bin/bash echo "Finished building at `date +%T` -- `pwd`" | sendmail "email@example.com" &
Ok, so on the unix machines at work, I realized sendmail is not available. So if you want this in a Sun Unix enviornment, use the following with mailto command.
#!/bin/bash echo "Finished building at `date +%T` -- `pwd`" | mailto "firstname.lastname@example.org" -s "nix"
This way I can simply append the “&& sms” after any command and when ever the previous command finishes, it will alert me with a quick SMS. The above script will include the username and host name in the from field by default, the time it finished and what the current directory it was in.
Other uses might be if you are doing any type of simulations, you can append this to the end so you know the simulations are done. Other uses might be alert you when a hard drive fails using smartd or other types of triggered alerts. Hope you found this useful.