From 832beeef228c4b57104a9222df87d19f77e25679 Mon Sep 17 00:00:00 2001 From: Carlos V <76731844+cvc90@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:08:11 +0200 Subject: [PATCH] Update systeminfo.php Added new section of variables "Network stats" Updated "Storage usage" section Updated "Network" section --- front/systeminfo.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/front/systeminfo.php b/front/systeminfo.php index 4bf5eee0..39052e5a 100644 --- a/front/systeminfo.php +++ b/front/systeminfo.php @@ -93,6 +93,15 @@ $date = new DateTime(); $formatted_date = $date->format('l, F j, Y H:i:s'); $formatted_date2 = $date->format('d/m/Y H:i:s'); $formatted_date3 = $date->format('Y/m/d H:i:s'); +//Network stats +// Check Server name +if (!empty(gethostname())) { $network_NAME = gethostname(); } else { $network_NAME = 'Server name not found'; } +// Check HTTPS +if (isset($_SERVER['HTTPS'])) { $network_HTTPS = 'Yes (HTTPS)'; } else { $network_HTTPS = 'No (HTTP)'; } +// Check Query String +if (empty($_SERVER['QUERY_STRING'])) { $network_QueryString = 'No query string'; } else { $network_QueryString = $_SERVER['QUERY_STRING']; } +// Check HTTP referer +if (empty($_SERVER['HTTP_REFERER'])) { $network_referer = 'No HTTP referer'; } else { $network_referer = $_SERVER['HTTP_REFERER']; } //Network Hardware stat $network_result = shell_exec("cat /proc/net/dev | tail -n +3 | awk '{print $1}'"); $net_interfaces = explode("\n", trim($network_result)); @@ -355,9 +364,9 @@ echo '
'; for ($x = 0; $x < sizeof($hdd_devices); $x++) { if (stristr($hdd_devices[$x], '/dev/')) { - if ($hdd_devices_total[$x] == 0) {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.');} - if ($hdd_devices_used[$x] == 0) {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.');} - if ($hdd_devices_free[$x] == 0) {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.');} + if ($hdd_devices_total[$x] == 0) {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_total = trim($temp_total);} + if ($hdd_devices_used[$x] == 0) {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_used = trim($temp_total);} + if ($hdd_devices_free[$x] == 0) {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_free = trim($temp_total);} echo '
'; echo '
Mount point "' . $hdd_devices_mount[$x] . '"
'; echo '
Total: ' . $temp_total . ' GB
'; @@ -390,7 +399,7 @@ echo '
Server name:
-
' . $_SERVER['SERVER_NAME'] . '
+
' . $network_NAME . '
Connection port:
@@ -398,7 +407,7 @@ echo '
Secure connection:
-
' . $_SERVER['HTTPS'] . '
+
' . $network_HTTPS . '
Server Version:
@@ -410,7 +419,7 @@ echo '
Server query:
-
' . $_SERVER['QUERY_STRING'] . '
+
' . $network_QueryString . '
HTTP host:
@@ -418,7 +427,7 @@ echo '
HTTP referer:
-
' . $_SERVER['HTTP_REFERER'] . '
+
' . $network_referer . '
MIME:
@@ -443,7 +452,6 @@ echo '
'; - // Network Hardware ---------------------------------------------------------- echo '