Commit 024af999 authored by dmorley's avatar dmorley

switch to uptimerobot, pindom killed off free

parent ebdc3eeb
......@@ -15,11 +15,11 @@ if (!$_POST['domain']){
die;
}
if (!$_POST['url']){
echo "no pingdom url for your stats";
echo "no API key for your stats";
die;
}
if (substr_count($_POST['url'], '/') != 4){
echo "pingdom url bad, needs to look like http://stats.pingdom.com/xxxxxxxxxxx/xxxxxx";
if (strlen($_POST['url']) < 14){
echo "API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee";
die;
}
......@@ -37,7 +37,7 @@ if ($row["domain"] == $_POST['domain']) {
echo "domain already exists";die;
}
if ($row["pingdomurl"] == $_POST['url']) {
echo "pingdom report already exists";die;
echo "API key already exists";die;
}
}
......
......@@ -102,6 +102,7 @@ unset($adminratingavg);
curl_setopt($ch, CURLOPT_NOBODY, 1);
$output = curl_exec($ch);
curl_close($ch);
if ($debug) {print $output;}
if ($debug) {print $outputssl;}
if (stristr($outputssl, '_diaspora_session')) {
//parse header data
......@@ -164,14 +165,15 @@ if ($secure == "true") {$sorno = "s";} else {$sorno- "";}
curl_setopt($chksup, CURLOPT_NOBODY, 1);
$outputchksup = curl_exec($chksup);
curl_close($chksup);
if ($debug) {print $outputchksup;}
preg_match('/Status:(.*?)\n/',$outputchksup,$xsignupon);
$signupon = isset($xsignupon[1])?trim($xsignupon[1]):null;
$signupon = substr($signupon, 0, 3);
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 a pod is not displaying the git header data its really really really old lets lower your score
//$hidden="yes";
......@@ -236,7 +238,7 @@ if (strpos($row[$i]['pingdomurl'], "pingdom.com")) {
$pingdom = curl_exec($ping);
$info = curl_getinfo($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) {
//response time
......@@ -249,7 +251,7 @@ preg_match_all('/"historySelect">\s*(.*?)\s*<\/select/is',$pingdom,$matchhistory
$implodemonths = implode(" ", $matchhistory[1]);
preg_match_all('/<option(.*?)/s',$implodemonths,$matchdates);
$months = isset($matchdates[0])?count($matchdates[0]):0;
echo $matchdates[0];
//echo $matchdates[0];
//uptime %
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;
......@@ -302,11 +304,10 @@ domain=$29";
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";}
//end foreach
sleep($sleep);
}
}
pg_free_result($result);
......
......@@ -6,7 +6,7 @@ else
echo "Checking for internet";
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
sleep 2
......@@ -17,8 +17,8 @@ exit;
else
echo "Pulling in new pod data";
cd /var/www/podup/db
php5 pull.php
touch last.data
php5 pull.php debug=1
touch last.data
php5 backup.php
rm /tmp/index.google
fi
......@@ -96,12 +96,10 @@ s1.parentNode.insertBefore(s, s1);
<div id="howto" style="display:none; margin-left:50px">
<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>
<br>Make a public report public and then enter your URL below (note its the one you view after you goto it)<br><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>
Its easy start monitoring on your pod with a free <a href="https://uptimerobot.com" target="new">Uptime Robot</a> account.<br>
Create a monitor for your pod, then in "My Settings" create a monitor-specific API key and paste below.<br>
<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>
Your Email:<input type="text" name="email" class="xlarge span4" placeholder="user@domain.com"><br>
<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