about us

simplewebhosting.co.uk blog simplewebhosting.co.uk blog

Posts Tagged ‘pingdom’

Uptime figures for March

Sunday, April 1st, 2012

We work hard every month to ensure simplewebhosting.co.uk hosted websites are available every single minute of every single day and in March we did just that! An awesome 100% uptime for the whole month. Well done everyone!

Monitored by Pingdom

February Uptime Figures

Thursday, March 1st, 2012

February’s web hosting uptime figures are in and it’s an impressive 99.96% across our network. This figure includes a large PHP upgrade completed on each machine.

Monitored by Pingdom

Automatically post Pingdom updates to your Twitter feed

Thursday, October 22nd, 2009

If you’re an avid Pingdom supporter (like us) and you want to keep your customers up-to-date with your server uptime, then you may be interested in this little PHP script that will post Pingdom alerts to your Twitter feed.

It’s very simple and works well for us (@simplestatus) and you’re free to use/modify it as you wish.

1) Add an e-mail contact at Pingdom (eg: pingdom2twitter@yourdomain.com) and assign that contact to the appropriate checks.

2) Create an e-mail forwarder to ‘pipe’ e-mail sent to your new address to your script (in cPanel use Mail – Forwarders, choose Pipe to a Program and enter the full path to the script).

3) Enter your Twitter username and password in the PHP script below and upload to your server.

#!/usr/local/bin/php -q
 $fp = @fopen(“php://stdin”, “r”);
 if ($fp > 0) {
      while(!feof($fp)) {
          $line=fgets($fp, 120);
    $data .= $line;
    if (!isset($body)) {
      $headersmm .= $line;
              if(ereg(“^From:(.+)”,$line)) {
                  $line=ereg_replace (“\\\n”,””,$line);
                  finasteride propecia $sender=$line;
              if(ereg(“^Subject:(.+)”,$line)) {
                  $line=ereg_replace (“\\\n”,””,$line);
              if(ereg(“^Content-Type:(.+)”,$line)) {
                  $line=ereg_replace (“\\\n”,””,$line);
              if(ereg(“^\\\n”,$line)) {
          else {

//Get server name from inside brackets (bit naff I know but it does the job!)
preg_match(‘#\(([^)]+)\)#’, $body, $server);

if(strstr($body,”PingdomAlert DOWN”)) {
          $tweet = “Oopsy daisy – ” . $server[1] . ” is having some problems – but don’t worry, we’re looking into it now. [Pingdom]”;
} elseif(strstr($body,”PingdomAlert UP”)) {
          $tweet = “Phew – ” . $server[1] . ” is back online again. Apologies for the brief downtime. [Pingdom]”;

// Post tweet (thanks to http://morethanseven.net/2007/01/20/posting-to-twitter-using-php/)

// Set username and password
$username = ‘TWITTERUSERNAME’;
$password = ‘TWITTERPASSWORD’;
// The message you want to send
$message = $tweet;
// The twitter API address
$url = ‘http://twitter.com/statuses/update.xml’;
// Alternative JSON version
// $url = ‘http://twitter.com/statuses/update.json’;
// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, “$url”);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, “status=$message”);
curl_setopt($curl_handle, CURLOPT_USERPWD, “$username:$password”);
$buffer = curl_exec($curl_handle);



about us

blog blog


blog categories blog categories


blog archives blog archives


blog categories popular blogs


10 reasons 10 reasons to choose simplewebhosting.co.uk