{
my $server = {
cluster => $cluster,
- pingdom => $cluster->{pingdom},
+ statuscake => $cluster->{statuscake},
bandwidth => $cluster->{bandwidth},
ipv4 => $cluster->{ipv4},
ipv6 => $cluster->{ipv6}
$server->{status} = "up";
}
-# If pingdom support is enabled then check which servers are up
-if ($ENV{PINGDOM_USERNAME} && $ENV{PINGDOM_PASSWORD})
+# If statuscake support is enabled then check which servers are up
+if ($ENV{STATUSCAKE_USERNAME} && $ENV{STATUSCAKE_APIKEY})
{
my $ua = LWP::UserAgent->new;
my $cache;
- $ua->timeout(5);
- $ua->default_header("App-Key", "2cohi62u5haxvqmypk3ljqqrze1jufrh");
- $ua->credentials("api.pingdom.com:443", "Pingdom API", $ENV{PINGDOM_USERNAME}, $ENV{PINGDOM_PASSWORD});
+ $ua->agent("mkgeo/1.0");
+ $ua->default_header("Username", $ENV{STATUSCAKE_USERNAME});
+ $ua->default_header("API", $ENV{STATUSCAKE_APIKEY});
- if (-f "pingdom.yml")
+ if (-f "statuscake.yml")
{
- $cache = YAML::LoadFile("pingdom.yml");
+ $cache = YAML::LoadFile("statuscake.yml");
}
else
{
$cache = {};
}
- foreach my $server (@servers)
+ my $response = $ua->get("https://app.statuscake.com/API/Tests/");
+
+ if ($response->is_success)
{
- if (my $checkid = $server->{pingdom})
+ my $tests = decode_json($response->content);
+
+ foreach my $test (@$tests)
{
- my $response = $ua->get("https://api.pingdom.com/api/2.0/checks/${checkid}");
+ my $testid = $test->{TestID};
- if ($response->is_success)
+ if ($test->{Status} eq "Up" && !$test->{Paused})
{
- my $check = decode_json($response->content);
-
- $server->{status} = $check->{check}->{status};
- $cache->{$server->{pingdom}} = $check->{check}->{status};
+ $cache->{$testid} = "up";
}
else
{
- $server->{status} = $cache->{$server->{pingdom}} || "down";
+ $cache->{$testid} = "down";
+ }
+ }
+ }
+
+ foreach my $server (@servers)
+ {
+ if (my $testids = $server->{statuscake})
+ {
+ $server->{status} = "up";
+
+ for my $testid (@$testids)
+ {
+ my $testresult = $cache->{$testid} || "down";
+
+ $server->{status} = "down" if $testresult eq "down";
}
}
else
}
}
- YAML::DumpFile("pingdom.yml", $cache);
+ YAML::DumpFile("statuscake.yml", $cache);
}
# Mark a cluster as up if any servers are up
moscow:
lat: 55.75
lon: 37.617
- pingdom: 659912
+ statuscake:
+ - 2217257
+ - 2217258
colour: "#412c84"
bandwidth: 175
ipv4: 5.45.248.21
amsterdam:
lat: 52.37306
lon: 4.89222
- pingdom: 766251
+ statuscake:
+ - 2217259
+ - 2217260
colour: "#a1b92e"
bandwidth: 60
ipv4: 134.90.146.26
oslo:
lat: 59.94944
lon: 10.75639
- pingdom: 769267
+ statuscake:
+ - 2217261
+ - 2217262
colour: "#7c1f7c"
bandwidth: 30
ipv4: 31.169.50.10
sanfrancisco:
lat: 37.708264
lon: -122.280247
- pingdom: 788480
+ statuscake:
+ - 2217263
+ - 2217264
colour: "#25567b"
bandwidth: 20
ipv4: 64.62.205.202
lyon:
lat: 45.7575958
lon: 4.8323239
- pingdom: 789594
+ statuscake:
+ - 2217265
+ - 2217266
colour: "#bf6530"
bandwidth: 70
ipv4: 77.95.70.166
ipv6: 2a0391800001002100000000000000a6
-# Falkenstein/Jena, DE
+# Falkenstein/Jena/Berlin, DE
# Falkenstain @ 50.47822,12.33607
# Jena @ 50.9411,11.60085
# Berlin @
lon: 12.78809
colour: "#562781"
servers:
- - pingdom: 1483284
+ - statuscake:
+ - 2217269
+ - 2217270
bandwidth: 100
ipv4: 144.76.70.77
ipv6: 2a0104f80191834c0000000000000002
- - pingdom: 1486872
+ - statuscake:
+ - 2217271
+ - 2217272
bandwidth: 100
ipv4: 81.7.11.83
ipv6: 2a020180000100010000000005170b53
- - pingdom: 2441982
+ - statuscake:
+ - 2217293
+ - 2217294
bandwidth: 100
ipv4: 185.66.195.245
ipv6: 2a032260200000010000000000000005
lon: -111.642765
colour: "#1f7c65"
servers:
- - pingdom: 909444
+ - statuscake:
+ - 2217273
+ - 2217274
bandwidth: 30
ipv4: 192.163.219.36
- - pingdom: 909445
+ - statuscake:
+ - 2217275
+ - 2217276
bandwidth: 30
ipv4: 192.163.219.40
allowed:
lat: 40.395278
lon: 49.882222
colour: "#bfb830"
- pingdom: 1064415
+ statuscake:
+ - 2217267
+ - 2217268
bandwidth: 50
ipv4: 94.20.20.55
allowed:
lat: 24.78268
lon: 120.99563
colour: "#bf3030"
- pingdom: 1124306
+ statuscake:
+ - 2217277
+ - 2217278
bandwidth: 50
ipv4: 140.110.240.7
ipv6: 20010e10200002400000000000000007
pula:
lat: 44.866280
lon: 13.851520
- pingdom: 1453872
+ statuscake:
+ - 2217279
+ - 2217280
colour: "#bf9430"
bandwidth: 120
ipv4: 193.198.233.211
osijek:
lat: 45.55656
lon: 18.71212
- pingdom: 1840482
+ statuscake:
+ - 2217281
+ - 2217282
colour: "#269926"
bandwidth: 80
ipv4: 161.53.30.107
lat: 51.5120484
lon: -0.00201880060605929
pingdom: 1453871
+ statuscake:
+ - 2214077
+ - 2217246
colour: "#7ab02c"
bandwidth: 100
ipv4: 185.73.44.30
corvallis:
lat: 44.5639267
lon: -123.274707837676
- pingdom: 1454011
+ statuscake:
+ - 2217287
+ - 2217288
colour: "#a1285f"
bandwidth: 80
ipv4: 140.211.167.105
budapest:
lat: 47.4925
lon: 19.051389
- pingdom: 1530226
+ statuscake:
+ - 2217283
+ - 2217284
colour: "#2c3d82"
bandwidth: 60
ipv4: 37.17.173.8
minsk:
lat: 53.88586
lon: 27.45368
- pingdom: 1941482
+ statuscake:
+ - 2217285
+ - 2217286
colour: "#bfa730"
bandwidth: 50
ipv4: 31.130.201.40
aalborg:
lat: 57.0159232
lon: 9.97532374746345
- pingdom: 2295843
+ statuscake:
+ - 2217289
+ - 2217290
colour: "#bf8230"
bandwidth: 30
ipv4: 130.225.254.123
zaragoza:
lat: 41.64207
lon: -0.90054
- pingdom: 2329063
+ statuscake:
+ - 2217291
+ - 2217292
colour: "#bfa730"
bandwidth: 30
ipv4: 155.210.4.103