status.php 2.04 KB
Newer Older
dmorley's avatar
dmorley committed
1 2 3 4 5 6 7 8 9 10
<?php

declare(strict_types=1);

require_once __DIR__ . '/boot.php';

use Carbon\Carbon;

$pods_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('pods_updated', 'date_created'))->diffInMinutes();
echo "<small>";
dmorley's avatar
dmorley committed
11
if ($pods_updated_stats < c('status_green')) {
dmorley's avatar
dmorley committed
12 13 14 15
    echo "System status is Green<br>";
} else {
    echo "System status is Red<br>";
}
dmorley's avatar
dmorley committed
16 17 18
$pods_updated_stats_human = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('pods_updated', 'date_created'))->diffForHumans();

echo "Last Update was " . $pods_updated_stats_human . "<br>";
dmorley's avatar
dmorley committed
19 20 21

echo "Last Update run duration was " . getMeta('pods_update_runtime') . " minutes<br>";

dmorley's avatar
dmorley committed
22 23
$lang_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('languages_updated', 'date_created'))->diffForHumans();
echo "Last Language check was " . $lang_updated_stats . "<br>";
dmorley's avatar
dmorley committed
24

dmorley's avatar
dmorley committed
25 26
$back_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('backup', 'date_created'))->diffForHumans();
echo "Last Local SQL Backup was " . $back_updated_stats . "<br>";
dmorley's avatar
dmorley committed
27

dmorley's avatar
dmorley committed
28 29
$masterversions_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('masterversions_updated', 'date_created'))->diffForHumans();
echo "Last Masterversion update from repos was " . $masterversions_updated_stats . "<br>";
dmorley's avatar
dmorley committed
30

dmorley's avatar
dmorley committed
31 32
$federation_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('federation_updated', 'date_created'))->diffForHumans();
echo "Last Federation crawl was " . $federation_updated_stats . "<br>";
dmorley's avatar
dmorley committed
33

dmorley's avatar
dmorley committed
34 35
$statstable_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('statstable_updated', 'date_created'))->diffForHumans();
echo "Last Monthly stats table update was " . $statstable_updated_stats . "<br>";
dmorley's avatar
dmorley committed
36

dmorley's avatar
dmorley committed
37 38
$cacert_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('cacert_updated', 'date_created'))->diffForHumans();
echo "Last CACert update was " . $cacert_updated_stats . "<br>";
dmorley's avatar
dmorley committed
39

dmorley's avatar
dmorley committed
40 41
$geoip_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('geoip_updated', 'date_created'))->diffForHumans();
echo "Last GEOIP DB update was " . $geoip_updated_stats . "<br>";
dmorley's avatar
dmorley committed
42 43

echo "</small>";