Comments (16)
Quickfix: (works for me)
/statuspage/statusPage.php
Replace getChecksJson()
Replace API-KEY with your own Api-Key
private function getChecksJson($action)
{
$apiKey = constant('apiKey');
$historyDay = constant('historyDay');
$url = 'https://api.uptimerobot.com/getMonitors?apikey=API-KEY&format=json&noJsonCallback=1&customUptimeRatio=1-7-30-360';
if ($action){
$url .= '&logs=1&responseTimes=1&responseTimesAverage=30&showTimezone=1';
}
if (constant('includedMonitors') != '') {
$monitors = constant('includedMonitors');
$url .= "&monitors=$monitors";
}
if (constant('searchMonitors') != '') {
$search = constant('searchMonitors');
$url .= "&search=$search";
}
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
#CURLOPT_USERAGENT => 'UptimeRobot Public Status Page',
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_CONNECTTIMEOUT => 15
));
$checks = json_decode(curl_exec($curl), TRUE);
//Checks to make sure curl is happy
if (curl_errno($curl)) {
return False;
}
curl_close($curl);
//Checks to make sure UptimeRobot didn't return any errors
if ($checks['stat'] != 'ok') {
error_log('UptimeRobot API Error - ' . $checks['message']);
return False;
}
return $checks;
}
from statuspage.
Anyone?
from statuspage.
yes
from statuspage.
Any errors in your webserver logs?
from statuspage.
Hello, i get the Same error.
PHP Log File:
`[15-Feb-2016 07:49:34 UTC] PHP Notice: Undefined variable: allCheckID in C:\xampp\htdocs\status\build\statuspage\statusPage.php on line 103
[15-Feb-2016 07:49:34 UTC] PHP Notice: Undefined variable: allCheckInfo in C:\xampp\htdocs\status\build\statuspage\statusPage.php on line 41
`
I am using :
Windows Server 2012
and Xampp
from statuspage.
The variables are missing (undefined) if there are no monitors/accounts connected and therefore no loops accessed.
I've added the missing variable definitions in my PR #38
from statuspage.
Here is another error I got from the check.php:
`Warning: Invalid argument supplied for foreach() in /web/statuspage/statusPage.php on line 49
Warning: Invalid argument supplied for foreach() in /web/statuspage/statusPage.php on line 23
StatusPage({"headers":["Past 24 Hours","Past Week","Past Month","Past Year","Total"],"checks":null})`
How do I fix this?
from statuspage.
@timhal15 do you use the contents from /backend/statuspage
or /build/statuspage
? The backend-Files are out of date. Also my update only includes the build-files.
Have you checked out my fix (https://github.com/lduer/StatusPage/tree/fix_issue34
)? The PR is not yet merged and the released zip-archive therefore not updated.
Your warning from L49 occures when the variable contains no monitors. This is already fixed in the build/statuspage/statusPage.php#L51
from statuspage.
@lduer yes I use the file you fixed, the unhappy face no longer exist. But still nothing shows up....
Got the error reported:
`Uncaught TypeError: Cannot read property 'log' of undefined
$.ajax.success @ statuspage.min.js:41
u @ statuspage.min.js:31
c.fireWith @ statuspage.min.js:31
n @ statuspage.min.js:32
(anonymous function) @ statuspage.min.js:32
`
from statuspage.
could you please paste the response you get from the check.php
, when it is called via ajax-request from the index?
from statuspage.
I've tried with /build/statuspage
but error is the same on line 23 and 49.
The response from my check.php is the following:
StatusPage({"headers":["Past 24 Hours","Past Week","Past Month","Past Year","Total"],"checks":null})
thx
from statuspage.
work very fine, thank You
On 19 Jul 2016, at 11:53, Chris6284 [email protected] wrote:
Quickfix: (works for me)
/statuspage/statusPage.php
Replace getChecksJson()
Replace API-KEY with your own Api-Keyprivate function getChecksJson($action)
{
$apiKey = constant('apiKey');
$historyDay = constant('historyDay');if ($action){
$url .= '&logs=1&responseTimes=1&responseTimesAverage=30&showTimezone=1';
}
if (constant('includedMonitors') != '') {
$monitors = constant('includedMonitors');
$url .= "&monitors=$monitors";
}if (constant('searchMonitors') != '') {
$search = constant('searchMonitors');
$url .= "&search=$search";
}$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url,
#CURLOPT_USERAGENT => 'UptimeRobot Public Status Page',
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_CONNECTTIMEOUT => 15
));$checks = json_decode(curl_exec($curl), TRUE);
//Checks to make sure curl is happy
if (curl_errno($curl)) {
return False;
}
curl_close($curl);//Checks to make sure UptimeRobot didn't return any errors
if ($checks['stat'] != 'ok') {
error_log('UptimeRobot API Error - ' . $checks['message']);
return False;
}return $checks;
}—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub #37 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ACS6q9u2u3UGuPN4pA5DjRXAiUH3lGDpks5qXJ6AgaJpZM4G77FD.
from statuspage.
@Zillionx @Chris6284
Works fine for me, however, is there any way to use not modifying this file(use the apikey setted in config.php instead)?
Thanks
from statuspage.
where Replace getChecksJson() and Replace API-KEY with your own Api-Key ?
thx
from statuspage.
@wang259797
I guess what he/she mean was that, well, check the following line:
You gotta to get your own API-KEY from uptimebot, which will generate one for you in the dashboard.
Copy and paste that key and place them after "apikey="
from statuspage.
How do you restrict to say 3 monitors ?
(edit - found answers here #27)
from statuspage.
Related Issues (20)
- Spell correct HOT 1
- statuspage.min.js not in unix format
- statuspage.min.js not in unix format HOT 8
- Format of 'includedMonitors' and 'excludedMonitors'? HOT 6
- update errors if cache is expired. HOT 2
- HTML entities are not being rendered HOT 1
- 41+ checks: Table grows too large into the credits! HOT 1
- An Error Has Occured? HOT 3
- Friendly err info needed
- Error info in the apache2 log HOT 1
- No Data and PHP Errors HOT 2
- Performance Optimization Suggestion HOT 2
- Suggestion: Add categories or groups to monitors
- Make compatible with API v2 HOT 12
- Blank screen: Undefined index messages on FreeBSD 11 system
- "An error has occured :(" and #32 fix didn't work. HOT 2
- API version 2 HOT 11
- alertBar messages: Suggestion
- -snip-
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statuspage.