Fail Notifier - Get Real-Time Notifications When Stuff Fails
Update - Unfortunately, Notifo closed up and ceased operations in January 2013, so this tool is no longer functional.
Last week, I was doing some routine maintenance on my VPS (which I should definitely do more often, as well as writing some more blog posts) and I noticed that one of my cron jobs that backed up some files to Tarsnap was incorrect and silently failing. Now, I could modify this simple Bash script to shoot off an email to me whenever something happens. But I was feeling a bit creative and didn't want to just write a few lines of Bash and be done with it.
As any software engineer is prone to do, I wanted to build something a bit more cool. That's when I figured out that this would be the perfect chance to finally do something useful with Notifo. Notifo is an awesome service that provides real-time notifications to a number of devices, in particular to iPhones (although their list of supported devices seems to be rapidly expanding). I've been using Notifo just for setting up simple timed reminders and to get notified of replies and mentions from Twitter using push.ly. Getting notifications in real-time of failures would be something great to have.
Using Ruby,, Sinatra and the Notifo gem, I quickly whipped up a small app called Fail Notifier. Basically it's a service where any application / server can make a simple HTTP POST to where Fail Notifier is running, and it will relay the message to the user in real-time using Notifo. Simple, but very useful. The best thing is that you can use it anywhere to notify you about anything from any app, programming language, server, or anything else that can make a simple HTTP request. For example, I have Fail Notifier installed on my VPS (nginx and the recently-released <a href="http://www.modrails.com/>Phusion Passenger 3.0.0, for those who are curious) and configured my cron jobs to notify me via Bash / cURL about some failures, and I also have some notifications for very important background tasks in a Rails app.
Of course, Fail Notifier is entirely open-source for you to do with it as you please. Feel free to fork the code on Github and hack away to your hearts content.