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
ac467df8
Commit
ac467df8
authored
Sep 07, 2013
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix no pingdom stats page error
parent
47c37fda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
db/pull.php
db/pull.php
+11
-3
No files found.
db/pull.php
View file @
ac467df8
<?php
$debug
=
isset
(
$_GET
[
'debug'
])
?
1
:
0
;
$debug
=
isset
(
$argv
[
1
])
?
1
:
0
;
//* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */
include
(
'config.php'
);
//get master code version
...
...
@@ -111,7 +112,7 @@ if (!$dver) {$score = $score-2;}
preg_match
(
'/X-Runtime: (.*?)\n/'
,
$outputssl
,
$xruntime
);
$runtime
=
trim
(
$xruntime
[
1
]);
preg_match
(
'/Server: (.*?)\n/'
,
$outputssl
,
$xserver
);
$server
=
trim
(
$xserver
[
1
])
;
$server
=
isset
(
$xserver
[
1
])
?
trim
(
$xserver
[
1
])
:
null
;
preg_match
(
'/Content-Encoding: (.*?)\n/'
,
$outputssl
,
$xencoding
);
if
(
$xencoding
)
{
$encoding
=
trim
(
$xencoding
[
1
]);}
else
{
$encoding
=
null
;}
...
...
@@ -194,7 +195,7 @@ if (strpos($row[$i]['pingdomurl'], "pingdom.com")) {
$ping
=
curl_init
();
$thismonth
=
"/"
.
date
(
"Y"
)
.
"/"
.
date
(
"m"
);
curl_setopt
(
$ping
,
CURLOPT_URL
,
$row
[
$i
][
'pingdomurl'
]
.
$thismonth
);
if
(
$debug
)
{
echo
$row
[
$i
][
'pingdomurl'
]
.
$thismonth
;}
if
(
$debug
)
{
echo
$row
[
$i
][
'pingdomurl'
]
.
$thismonth
;}
curl_setopt
(
$ping
,
CURLOPT_POST
,
0
);
curl_setopt
(
$ping
,
CURLOPT_HEADER
,
1
);
curl_setopt
(
$ping
,
CURLOPT_RETURNTRANSFER
,
1
);
...
...
@@ -203,8 +204,11 @@ if ($debug) {echo $row[$i]['pingdomurl'].$thismonth;}
curl_setopt
(
$ping
,
CURLOPT_MAXCONNECTS
,
5
);
curl_setopt
(
$ping
,
CURLOPT_FOLLOWLOCATION
,
true
);
$pingdom
=
curl_exec
(
$ping
);
$info
=
curl_getinfo
(
$ping
);
curl_close
(
$ping
);
//if ($debug) {echo "Pingdom: ".$pingdom."<br>";}
if
(
$debug
)
{
echo
"Pingdom code: "
.
$info
[
'http_code'
]
.
"<br>"
;}
if
(
$info
[
'http_code'
]
==
200
)
{
//response time
preg_match_all
(
'/<h3>Avg. resp. time this month<\/h3>
<p class="large">(.*?)</'
,
$pingdom
,
$matcheach
);
...
...
@@ -237,6 +241,10 @@ elseif (strpos($pingdom,"class=\"down\"")) { $live="down"; }
elseif
(
strpos
(
$pingdom
,
"class=
\"
paused
\"
"
))
{
$live
=
"paused"
;}
else
{
$live
=
"error"
;
$score
=
$score
-
2
;}
}
else
{
//pingdom url is <> 200 so stats are gone, lower score
$score
=
$score
-
2
;
}
}
else
{
//do uptimerobot API instead
$ping
=
curl_init
();
curl_setopt
(
$ping
,
CURLOPT_URL
,
"http://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey="
.
$row
[
$i
][
'pingdomurl'
]);
...
...
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