Commit 0301f715 authored by dmorley's avatar dmorley
Browse files

Lower score if your uptimerobot api key is bad

parent eb27b372
...@@ -289,6 +289,7 @@ $score=$score-2; ...@@ -289,6 +289,7 @@ $score=$score-2;
$up2 = substr ($uptimerobot, strlen($json_encap) - 1, strlen ($uptimerobot) - strlen($json_encap)); $up2 = substr ($uptimerobot, strlen($json_encap) - 1, strlen ($uptimerobot) - strlen($json_encap));
$uptr = json_decode($up2); $uptr = json_decode($up2);
$responsetime = 'n/a'; $responsetime = 'n/a';
$uptimerobotstat = $uptr->stat;
$uptime = $uptr->monitors->monitor{'0'}->alltimeuptimeratio; $uptime = $uptr->monitors->monitor{'0'}->alltimeuptimeratio;
$diff = abs(strtotime(date('Y-m-d H:i:s')) - strtotime($dateadded)); $diff = abs(strtotime(date('Y-m-d H:i:s')) - strtotime($dateadded));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
...@@ -298,6 +299,10 @@ if ($uptr->monitors->monitor{'0'}->status == 8) {$live = "Seems Down";} ...@@ -298,6 +299,10 @@ if ($uptr->monitors->monitor{'0'}->status == 8) {$live = "Seems Down";}
if ($uptr->monitors->monitor{'0'}->status == 9) {$live = "Down";} if ($uptr->monitors->monitor{'0'}->status == 9) {$live = "Down";}
$pingdomdate = date('Y-m-d H:i:s'); $pingdomdate = date('Y-m-d H:i:s');
if ($uptimerobotstat == "fail") {
$score=$score-2;
}
} }
//sql it //sql it
$timenow = date('Y-m-d H:i:s'); $timenow = date('Y-m-d H:i:s');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment