From d6b1d9fc47aac9f4bfef8afb8255c15c12d160d3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Sep 2025 18:25:35 +0000 Subject: [PATCH 1/3] Initial plan From 1aae4b4b83b8e19e8e6ac1ccda5b35eb41c102c0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Sep 2025 18:30:50 +0000 Subject: [PATCH 2/3] Create standalone server status page Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- server_status.php | 291 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 server_status.php diff --git a/server_status.php b/server_status.php new file mode 100644 index 00000000..5110a5f0 --- /dev/null +++ b/server_status.php @@ -0,0 +1,291 @@ +getUserById($_SESSION['user_id']); + +// Get settings +$settings = $db->getSettings(); +@$GLOBALS['panel_language'] = $settings['panel_language']; +ogpLang(); + +function ping_host($host, $timeout = 5) { + if (function_exists('exec')) { + $output = array(); + $result = 0; + + // Use ping command based on OS + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + exec("ping -n 1 -w " . ($timeout * 1000) . " " . escapeshellarg($host), $output, $result); + } else { + exec("ping -c 1 -W " . $timeout . " " . escapeshellarg($host), $output, $result); + } + + if ($result === 0) { + // Extract ping time from output + foreach ($output as $line) { + if (preg_match('/time[<=]([0-9.]+)\s*ms/i', $line, $matches)) { + return floatval($matches[1]); + } + } + return 0; // Host is up but couldn't extract time + } + } + return false; // Host is down or ping unavailable +} + +function get_hostname($ip) { + $hostname = gethostbyaddr($ip); + return ($hostname && $hostname !== $ip) ? $hostname : false; +} + +// Get all remote servers +$servers = $db->getRemoteServers(); + +?> + + +
+ + +| Server Name | +Location/IP | +Hostname | +Status | +Ping (ms) | +
|---|---|---|---|---|
| + |
+
+ () + + |
+ N/A'; ?> | ++ + 🟢 UP + + 🔴 DOWN + + | ++ + + ms + + + N/A + + | +