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.

Trackbacks


Trackback specific URI for this entry
    No Trackbacks

Comments


    #1 Mike on 01/21/10 at 10:25 AM [Reply]
    Good stuff but you should post a photo of how it looks! ;)
    #2 Mike on 01/21/10 at 11:22 AM [Reply]
    Oh yeah, how come your rss feed only shows one item?
    #3 Brendon Kozlowski on 01/21/10 at 12:06 PM [Reply]
    Humor aside, I suppose I could post a photo of the shell output ran manually, but to be honest I haven't even used this code, I'm more concerned about getting the CakePHP plugin's shell and task working, which I believe I just have...and it spits out much prettier syntax. As for the iPod Touch screen with the message intact, that would require more work. ;) We'll see.

    As for the RSS feed...when I tested all feeds available from the nav on the left (manually within Firefox) just now, ATOM versions shows 3, RSS versions show something like 10 or 15. I'm not really sure why you'd only be seeing one?
    #4 Mike on 01/21/10 at 01:01 PM [Reply]
    I'm subscribed to the rss2 feed. If you click the link in the left column for that, you will see it only includes one item.
    #4.1 Brendon Kozlowski on 01/21/10 at 02:39 PM [Reply]
    I'm seeing 15 items in the link from: http://life.mysiteonline.org/feeds/index.rss2

    If you were to view the source of the link rather than allow it to render, do you see more content? It's possible some of the values inserted in one (or more) of my posts are not allowing for proper reading in whatever feed reader you're using. I'm not sure what else it could be. The feed validators see more entries too.
    #5 Mike on 01/22/10 at 01:19 PM [Reply]
    Hmmm, now it's working. Never mind though, I am now subscribed to the rss1 feed instead...

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

BBCode format allowed