['timeout'=>5]]); $json = @file_get_contents($panel_summary, false, $ctx); if ($json === false) { echo "

Unable to load status.

"; exit; } $data = json_decode($json, true); $hosts = $data['hosts'] ?? []; echo ''; echo ''; echo ''; echo ''; echo ''; foreach ($hosts as $h) { $color = $h['status']==='UP' ? '#16a34a' : '#dc2626'; $cpu = is_null($h['cpu_pct']) ? '—' : number_format($h['cpu_pct'],1); $mem = is_null($h['mem_pct']) ? '—' : number_format($h['mem_pct'],1); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo '
LocationStatusCPU %MEM %
{$h['location']}{$h['status']}{$cpu}{$mem}
';