18
Mar 10

Nagios notifications via clickatell

Nagios SMS AlertThe most robust solution for sending SMS notifications of server issues detected by Nagios is well-known – plug a GSM modem (or a mobile phone) into your server directly and use that as the delivery mechanism. It’s true out-of-band communications, so if the backhaul fails completely, you still get notified.

However, for someone who has a small server like mine, in a geographically remote location (like Germany, in my case), that may be overkill. Especially as the cost includes both the initial cost of the hardware and the ongoing service charges. And for true out-of-band notification, you need far more admin time than may be appropriate for a small site; you have to have scheduled test of out-of-band notifications lest the hardware fail without detection, and so forth.

In my case, the requirement is far lower-spec; I just want to get a quick ping if the server starts to die so I can log in and try to effect repairs. If it’s an actual hardware failure, or an actual backhaul failure, odds are good that I can’t fix it from my end in a few minutes anyway, and we’re past the “fix it” part of the disaster recovery plan (you do have one, right?), and into the “get another temporary webhost and redirect using DNS” part of the DR plan (you do keep regular backups of your site locally, right?).

So my solution is equally lower-spec. I got an account with clickatell.com (there are several other web SMS gateways, I chose clickatell.com because I’m most familiar with them, not because of any objective evaluation) and enabled the HTTP/S API on the account and then wrote the following additions to the Nagios /etc/nagios3/commands.cfg file (again, this is for Debian, your file location may vary…):

[cc lang=”bash” escaped=”true”]define command{
command_name host_notify_with_sms
command_line wget “http://api.clickatell.com/http/sendmsg?user=INSERT_USERNAME_HERE&password=INSERT_PASSWORD_HERE&api_id=INSERT_API_ID_HERE&to=$CONTACTPAGER$&text=’$NOTIFICATIONTYPE$ Server is $HOSTSTATE$ ($HOSTOUTPUT$) @ $LONGDATETIME$'”
}

define command{
command_name service_notify_with_sms
command_line wget “http://api.clickatell.com/http/sendmsg?user=INSERT_USERNAME_HERE&password=INSERT_PASSWORD_HERE&api_id=INSERT_API_ID_HERE&to=$CONTACTPAGER$&text=’$NOTIFICATIONTYPE$ Server : $SERVICEDESC$ is $SERVICESTATE$ @ $LONGDATETIME$'”
}[/cc]

Then tell Nagios to use these new commands in /etc/nagios3/conf.d/contacts_nagios2.conf :

[cc lang=”ini”]define contact{

service_notification_commands   service_notify_with_sms notify-service-by-email
host_notification_commands      host_notify_with_sms notify-host-by-email

pager                           INSERT_MOBILE_PHONE_NUMBER_HERE
}
[/cc]

And now Nagios warnings and alerts are dispatched both by email (in a longer format) and by SMS. All very simply done, needing only wget to be installed. It’s easily testable as well – just call the wget line from the command line, like so:

[cc lang=”bash” escaped=”true”]wget “http://api.clickatell.com/http/sendmsg?user=INSERT_USERNAME_HERE&password=INSERT_PASSWORD_HERE&api_id=INSERT_API_ID_HERE&to=INSERT_MOBILE_PHONE_NUMBER_HERE&text=’This is a test message. If this was a real message, you would be panicking right now and desperately looking for a terminal.”[/cc]

Given the pricing structure in clickatell, it’s quite affordable – at the rate of normal usage, I should get a year’s coverage for around €50 or so, with capacity to spare. So it’s easy, cheap and testable. It’s not true out-of-band, but as 80% solutions go, it’s not too shabby.


17
Mar 10

Ben Nanonote with WiFi

Ben Nanonote

One of the reasons I love my Nokia e71 so much is that it’s a pretty decent example of convergence. Like the iPhone and others, it rolls so many features into one box that we’ve stopped calling these things mobile phones and started calling them mobile devices, almost without noticing. Heck, the ‘in-crowd’ just talks about ‘mobile’ as though the OED had recategorised that word from adjective to noun. It’s not so much linguistic arrogance as it is necessity – you have to go to science fiction or back to mythology to find examples of the kind of multifunction tool these devices have become and are still becoming.

The iPhone is without a doubt the poster boy for this, as its marketing is, ironically enough, pretty much founded on using it for things other than as an actual phone (and that’s why the iPad, daftly named as it is, will probably be a great success but not as great as its more dimunitive cousin. The whole attraction of the iPhone’s ability to be more than a phone is based on the fact that you are already carrying it around with you). One quick download and your phone becomes a translation device, a 2-D barcode reader, or any one of a few hundred other devices.

My problem is that I don’t really like the iPhone. It’s very slick and very pretty but… no background applications and a hefty price tag and to use it as intended, I pretty much have to have a mac. Sure, you can fake around that need, but it’s a chore. The Nokia e71 is wonderful in hardware (if you overlook the very poor camera which is hard pressed to handle the basic business task of recording the contents of a whiteboard after a brainstorming session — unforgivable given that mid-range phones handled this task better five years ago) but it’s awkward to setup with calendars and contacts and apps, even going through Ovi (which is why I’m still using a paper diary).

Once you decide against the iPhone and Nokia (and Blackberry because support for it in Ireland is again, all tied to one supplier and it’s not the best supported device here even though it’s huge in Asia), you’re pretty much left with the outliers right now, meaning Android. Yes, Android is an outlier. It gets great press without a doubt, but if you’re not a technology or gadget geek, it’s just another phone that’s a bit dingy-looking with its off-white case that doesn’t sit flat in a jacket pocket. Most people don’t know it’s a software platform, not a phone — and most of them wouldn’t understand what you meant if you told them (and amongst the real experts, btw, there are a few who don’t think much of it at all). And if you don’t mean Android, you’re right out there into the fringe at the moment. Which means stuff gets very interesting and individual indeed, which is where things like the 本 (běn) NanoNote come in:

Ben Nanonote from Qi Hardware

The Ben Nanonote looks like it might be a very interesting part of the fringe indeed. It’s small, but has a physical keyboard (humans like haptic interfaces for a good reason) and is completely open (both in hardware and software). Granted, it’s no speed demon – the iPhone ARM chips have a bit more oomph than it does – but even so, it could run a reasonably wide array of applications. It’s a long way from perfect, since it has no camera, no inbuilt wifi or inbuilt 3G or inbuilt WiMAX; but it’s intended as a first model and for a first model it’s got some promise.

Not least of which is that it costs around €70 at the moment. Add in the €60 you have to pay to get a supported microSD wifi card, and you’re still looking at less than a third of the cost of most netbooks over here. It’s a hobbyist platform rather than a serious do-work-on-this box at the moment, but looking at the upcoming Ya and Mu Nanonote platforms and seeing how building in wifi and other hardware is so possible, you have to ask the question of how long it’ll be until a commercial interest starts capitalising on the work Qi’s done here, and creates a larger market than just the hobbyist fringe. There’s a principle in open source software that the fastest way to change how something is done is to do it differently and release the code. Personally, I hope that trend holds true in hardware and we see a new market of palmtops acting as miniature netbooks; I would love to get a platform the size of the Nanonote, just with a few more networking options (as in, all of them – WiFi, WiMAX, 3G, LTE, the works). A true mobile device.

And yes, I still want an N900. If nothing else, it’d make a good stopgap measure 😀 In the meantime… well, €130 isn’t too much to drop to play with a toy like this, right?


12
Mar 10

Not-so-shortlisted!

Irish Blog Awards

I didn’t notice at the time, what with all the reddit fun, and then all the fun that happened on the server as a result of all the reddit fun, but @susan_lanigan kindly pointed out that I’ve been shortlisted in the Best Technology Blog section for the Irish Blog Awards. And, looking at the quality of the competition, I’m going to be insufferable for a little while that I’m considered to be in the same league, even if only after the first round of judging 🙂