Commit 024af999 authored by dmorley's avatar dmorley

switch to uptimerobot, pindom killed off free

parent ebdc3eeb
...@@ -15,11 +15,11 @@ if (!$_POST['domain']){ ...@@ -15,11 +15,11 @@ if (!$_POST['domain']){
die; die;
} }
if (!$_POST['url']){ if (!$_POST['url']){
echo "no pingdom url for your stats"; echo "no API key for your stats";
die; die;
} }
if (substr_count($_POST['url'], '/') != 4){ if (strlen($_POST['url']) < 14){
echo "pingdom url bad, needs to look like http://stats.pingdom.com/xxxxxxxxxxx/xxxxxx"; echo "API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee";
die; die;
} }
...@@ -37,7 +37,7 @@ if ($row["domain"] == $_POST['domain']) { ...@@ -37,7 +37,7 @@ if ($row["domain"] == $_POST['domain']) {
echo "domain already exists";die; echo "domain already exists";die;
} }
if ($row["pingdomurl"] == $_POST['url']) { if ($row["pingdomurl"] == $_POST['url']) {
echo "pingdom report already exists";die; echo "API key already exists";die;
} }
} }
......
...@@ -102,6 +102,7 @@ unset($adminratingavg); ...@@ -102,6 +102,7 @@ unset($adminratingavg);
curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_NOBODY, 1);
$output = curl_exec($ch); $output = curl_exec($ch);
curl_close($ch); curl_close($ch);
if ($debug) {print $output;}
if ($debug) {print $outputssl;} if ($debug) {print $outputssl;}
if (stristr($outputssl, '_diaspora_session')) { if (stristr($outputssl, '_diaspora_session')) {
//parse header data //parse header data
...@@ -164,14 +165,15 @@ if ($secure == "true") {$sorno = "s";} else {$sorno- "";} ...@@ -164,14 +165,15 @@ if ($secure == "true") {$sorno = "s";} else {$sorno- "";}
curl_setopt($chksup, CURLOPT_NOBODY, 1); curl_setopt($chksup, CURLOPT_NOBODY, 1);
$outputchksup = curl_exec($chksup); $outputchksup = curl_exec($chksup);
curl_close($chksup); curl_close($chksup);
if ($debug) {print $outputchksup;}
preg_match('/Status:(.*?)\n/',$outputchksup,$xsignupon); preg_match('/Status:(.*?)\n/',$outputchksup,$xsignupon);
$signupon = isset($xsignupon[1])?trim($xsignupon[1]):null; $signupon = isset($xsignupon[1])?trim($xsignupon[1]):null;
$signupon = substr($signupon, 0, 3); $signupon = substr($signupon, 0, 3);
if ($signupon == "200") {$signup = 1;} else {$signup = 0;} if ($signupon == "200") {$signup = 1;} else {$signup = 0;}
if ($debug) {echo "Signup Open: ".$signup."<br>";} if ($debug) {echo "<br>Signup Open: ".$signup."<br>";}
if ($debug) {echo "SSL: ".$secure."<br>";} if ($debug) {echo "<br>SSL: ".$secure."<br>";}
//if (!$gitdate) { //if (!$gitdate) {
//if a pod is not displaying the git header data its really really really old lets lower your score //if a pod is not displaying the git header data its really really really old lets lower your score
//$hidden="yes"; //$hidden="yes";
...@@ -236,7 +238,7 @@ if (strpos($row[$i]['pingdomurl'], "pingdom.com")) { ...@@ -236,7 +238,7 @@ if (strpos($row[$i]['pingdomurl'], "pingdom.com")) {
$pingdom = curl_exec($ping); $pingdom = curl_exec($ping);
$info = curl_getinfo($ping); $info = curl_getinfo($ping);
curl_close($ping); curl_close($ping);
if ($debug) {echo "Pingdom code: ".$info['http_code']."<br>";} if ($debug) {echo "<br>Pingdom code: ".$info['http_code']."<br>";}
if ($info['http_code'] == 200) { if ($info['http_code'] == 200) {
//response time //response time
...@@ -249,7 +251,7 @@ preg_match_all('/"historySelect">\s*(.*?)\s*<\/select/is',$pingdom,$matchhistory ...@@ -249,7 +251,7 @@ preg_match_all('/"historySelect">\s*(.*?)\s*<\/select/is',$pingdom,$matchhistory
$implodemonths = implode(" ", $matchhistory[1]); $implodemonths = implode(" ", $matchhistory[1]);
preg_match_all('/<option(.*?)/s',$implodemonths,$matchdates); preg_match_all('/<option(.*?)/s',$implodemonths,$matchdates);
$months = isset($matchdates[0])?count($matchdates[0]):0; $months = isset($matchdates[0])?count($matchdates[0]):0;
echo $matchdates[0]; //echo $matchdates[0];
//uptime % //uptime %
preg_match_all('/<h3>Uptime this month<\/h3>\s*<p class="large">(.*?)%</',$pingdom,$matchper); preg_match_all('/<h3>Uptime this month<\/h3>\s*<p class="large">(.*?)%</',$pingdom,$matchper);
$uptime = isset($matchper[1][0])?preg_replace("/,/", ".", $matchper[1][0]):0; $uptime = isset($matchper[1][0])?preg_replace("/,/", ".", $matchper[1][0]):0;
...@@ -302,11 +304,10 @@ domain=$29"; ...@@ -302,11 +304,10 @@ domain=$29";
die("Error in SQL query3: " . pg_last_error()); die("Error in SQL query3: " . pg_last_error());
} }
if ($debug) {echo "Score out of 20: ".$score."<br>";} if ($debug) {echo "<br>Score out of 20: ".$score."<br>";}
if (!$debug) {echo "Success";} if (!$debug) {echo "Success";}
//end foreach //end foreach
sleep($sleep);
} }
} }
pg_free_result($result); pg_free_result($result);
......
...@@ -6,7 +6,7 @@ else ...@@ -6,7 +6,7 @@ else
echo "Checking for internet"; echo "Checking for internet";
fi fi
$WGET -d --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google $WGET -q --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google
# &> /dev/null # &> /dev/null
sleep 2 sleep 2
...@@ -17,8 +17,8 @@ exit; ...@@ -17,8 +17,8 @@ exit;
else else
echo "Pulling in new pod data"; echo "Pulling in new pod data";
cd /var/www/podup/db cd /var/www/podup/db
php5 pull.php php5 pull.php debug=1
touch last.data touch last.data
php5 backup.php php5 backup.php
rm /tmp/index.google rm /tmp/index.google
fi fi
...@@ -96,12 +96,10 @@ s1.parentNode.insertBefore(s, s1); ...@@ -96,12 +96,10 @@ s1.parentNode.insertBefore(s, s1);
<div id="howto" style="display:none; margin-left:50px"> <div id="howto" style="display:none; margin-left:50px">
<br> <br>
Want your pod listed?<br> Want your pod listed?<br>
Its easy start monitoring on your pod with a free <a href="https://www.pingdom.com/free/" target="new">www.pingdom.com</a> account.<br> Its easy start monitoring on your pod with a free <a href="https://uptimerobot.com" target="new">Uptime Robot</a> account.<br>
<br>Make a public report public and then enter your URL below (note its the one you view after you goto it)<br><br> Create a monitor for your pod, then in "My Settings" create a monitor-specific API key and paste below.<br>
Pingdom shows me http://stats.pingdom.com/b4gasnh1c176 when I click it to goes to http://stats.pingdom.com/b4gasnh1c176/240588
<br> So URL should look very close to this: http://stats.pingdom.com/b4gasnh1c176/240588<br>
<br><form action="db/add.php" method="post"> <br><form action="db/add.php" method="post">
Stats URL:<input type="text" name="url" class="xlarge span8" placeholder="http://stats.pingdom.com/b4gasnh1c176/240588"><br> Monitor API Key:<input type="text" name="url" class="xlarge span8" placeholder="m58978-80abdb799f6ccf15e3e4ttwe"><br>
Pod domainname:<input type="text" name="domain" class="xlarge span4" placeholder="domain.com"><br> Pod domainname:<input type="text" name="domain" class="xlarge span4" placeholder="domain.com"><br>
Your Email:<input type="text" name="email" class="xlarge span4" placeholder="user@domain.com"><br> Your Email:<input type="text" name="email" class="xlarge span4" placeholder="user@domain.com"><br>
<input type="submit" value="submit"> <input type="submit" value="submit">
......
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