Howdy, Stranger!

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


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
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.