I recently had an outage of my mail service, which caused my delivery mailqueue to grow and grow. I was sick by the time and didn’t noticed that until two days later. The restart of the service caused my server to nearly drop dead delivering all the mail, checking for spam and viruses.
Of course I had set up a monitoring (via the wonderful [[http://www.zabbix.com|Zabbix]]). But that notifies me via— you guessed it: mail. So I needed another approach. I roamed around the internet trying to find a decent web sms service providing a nice API that I could access from my Zabbix server. I didn’t found one.
After a while my mobile rang as it was receiving a push about a direct message on twitter (you can find me there [[http://www.twitter.com/dploeger_it|@dploeger_it]] or the more funny and mostly german-speaking [[http://www.twitter.com/dploeger|@dploeger]]) and I had an idea. I quickly asked google about a CLI twitter client and found the wonderful [[http://t.co/YqTYANjj8y|Twidge]].
Twidge is very easy to set up. For a debianish box, it’s just
apt-get install twidge
and it will lead you to the usual Oauth-based authentication process. That will create a ~/.twidgerc-file with all details. After that just go ahead and type
twidge dmsend dploeger_it „Oh wow! I’ve set up twidge“
to send a direct message to @dploeger_it.
Of course, sending direct messages via twidge is subject to the usual rules of direct messages meaning that you have to follow the user and the user has to follow you.
Using this I quickly vamped up a shell script for Zabbix, that sends out Zabbix notification via a direct message to myself (which works in any case).
So now when something goes beserk, my mobile gets a push and spits out a nice „Pling“.
**Update**: Afterwards I noticed, that you should turn off url shortening in the twidgerc „twidge setup“ sets as a default, so your hostnames aren’t converted into short urls.