Uptime pingdom api

Uptime pingdom api

martip07martip07 Member
edited December 2012 in Help

How can I check how many hours a server is up using Pingdom API?

this is the example of php code that show days but I would lie to check and show days too.

thank you for your time:

https://github.com/martip07/pingdom-uptime-status/blob/master/index.php

http://mitihost.com/ -> Great Shared Hosting for a good $$

https://freevps.us/ -> Great P2H Forum to get free VPS's

Tagged:

Comments

  • Uptime is one thing, and time since last downtime is another.

    Pingdom can't give you a server's uptime.

    Fusioned | KVM SSD VPS | LSI RAID10 | Netherlands 1Gbps | R1Soft | IPv4 & IPv6 | SolusVM
  • mm good point .......

    http://mitihost.com/ -> Great Shared Hosting for a good $$

    https://freevps.us/ -> Great P2H Forum to get free VPS's

  • WintereiseWintereise Member
    edited December 2012

    Uptime since last downtime would be pretty easy to figure out from that snippet, but as George said, you can't find out the real uptime via pingdom.

    
        $response = json_decode(curl_exec($curl), true);
    if (isset($response['error'])) {
    exit('Error: ' . $response['error']['errormessage']);
    }
    $days = floor((time() - $response['check']['lasterrortime']) / 86400);
    
    $hours = // calculate $days * 24 here, should be easy ;)
    
    

    -- BOFH

Sign In or Register to comment.