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 ((array)$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 |