Buying Need a small script to ping a website's availability and email me if it's down

Discussion in 'Programming' started by sabin, Sep 23, 2011.

  1. #1
    One of my websites is very annoying, my web host having database server problems and leaving the server blocked until I manually reboot it.

    I need a script to email me when the database server stops responding, and only email me once (or just a few times) : I see little gain in being flooded with hundreds of notification emails until I do the reboot.

    I am not a php coder, only a person understanding the basics of it, so please tell me if I'm misunderstood !
    But I think it would be possible to insert a few script lines in my website's config.php to send me an email, and use leave some form of trace behind (how about editing a local text file with a time stamp, and avoid sending an email again until a new hour passed ? One email per hour would not be considered spam by me) to avoid sending the email again an unlimited number of times.

    My config.php uses that pattern :
    mysql_connect (credentials) or die (error message to my visitors);
    mysql_select_db or die(mysql_error());
    PHP:
    The limitations : my database server disallows remote connexions, so I can't host/cron the script elsewhere, it has to be ran locally. And the web host of that website doesn't take cron tasks/jobs (that's why I was thinking of hacking config.php, the only file loaded when the database server is down !).

    I hope it will be easy and fast to code it, it would help me a lot, so I'm willing to pay 20$ for this.

    PM me or leave me an offline ICQ message, my ID is 631148415.
    Thank you :)
     
    sabin, Sep 23, 2011 IP