iPhone Server Alerting on High Load

Friday, January 15. 2010

I have a shared Dreamhost account. In fact, I manage two: my own, and work's. Typically I don't too much care about my personal site going up or down, but I have multiple sites running under my account - and our work account with Dreamhost must maintain a decent responsiveness during business hours.

I've been developing a CakePHP plugin for Prowl but haven't quite polished it well enough for release. In the meantime, my work's Dreamhost account has had major issues where the server load would spike up to 350+ (I have no idea how many cores there are). That's just ludicrous. We've recently been moved to a new server by the support staff (for the 5th time) and although the average server load is now 0.40, I don't want to take my chances without a backup plan. Enter Prowl and my iPod Touch.

(To use Prowl, you would need an iPod touch or iPhone, and paid for and installed the Prowl application; it's $4.99 as of this writing. You then need to get your API from the prowl.preks.net website.)

We'll be using the PHP 3rd party API for Prowl, built by "Fenric", and we will go to his GitHub account to get it.

Once we have the PHP API for Prowl from Fenric, we'll build some quick code to make use of it:

This little script can easily be setup with a cronjob and automatically check the current server's load and report issues. It won't report if a server is down since it must run on the server it is reporting on, but it would help inform about possible problems that should be looked at. This could easily be extended to check the MySQL long query logs, or other reporting functions.
(Page 1 of 1, totaling 1 entries)