Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
024af999
Commit
024af999
authored
Jan 23, 2014
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch to uptimerobot, pindom killed off free
parent
ebdc3eeb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
18 deletions
+17
-18
db/add.php
db/add.php
+4
-4
db/pull.php
db/pull.php
+7
-6
db/pull.sh
db/pull.sh
+3
-3
index.php
index.php
+3
-5
No files found.
db/add.php
View file @
024af999
...
...
@@ -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
(
s
ubstr_count
(
$_POST
[
'url'
],
'/'
)
!=
4
){
echo
"
pingdom url bad, needs to look like http://stats.pingdom.com/xxxxxxxxxxx/xxxxxx
"
;
if
(
s
trlen
(
$_POST
[
'url'
])
<
1
4
){
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
;
}
}
...
...
db/pull.php
View file @
024af999
...
...
@@ -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
);
...
...
db/pull.sh
View file @
024af999
...
...
@@ -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
index.php
View file @
024af999
...
...
@@ -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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment