Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Uptime pingdom api
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

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

Comments

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

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

  • mm good point .......

  • 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 ;)
    
    
Sign In or Register to comment.