diff --git a/front/systeminfo.php b/front/systeminfo.php index c0f58eed..3825a5c7 100644 --- a/front/systeminfo.php +++ b/front/systeminfo.php @@ -63,12 +63,15 @@ if (file_exists('/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq')) { // Fallback $stat['cpu_frequ'] = "unknown"; } +$cpu_temp = shell_exec('cat /sys/class/thermal/thermal_zone0/temp'); // Get the CPU temperature +$cpu_temp = floatval($cpu_temp) / 1000; // Convert the temperature to degrees Celsius //Memory stats -$total_memory = shell_exec("cat /proc/meminfo | grep MemTotal | cut -d' ' -f2-") / 1024 | bc; -$mem_result = shell_exec("cat /proc/meminfo | grep MemTotal"); -$stat['mem_total'] = round(preg_replace("#[^0-9]+(?:\.[0-9]*)?#", "", $mem_result) / 1024 / 1024, 3); -$stat['mem_used'] = round(memory_get_usage() / 1048576 * 100, 2); -$memory_usage_percent = round(($stat['mem_used'] / $stat['mem_total']), 2); +$total_memorykb = shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2}'"); +$total_memorykb = number_format($total_memorykb, 0, '.', '.'); +$total_memorymb = shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2/1024}'"); +$total_memorymb = number_format($total_memorymb, 0, '.', '.'); +$mem_used = round(memory_get_usage() / 1048576 * 100, 2); +$memory_usage_percent = round(($mem_used / $total_memorymb), 2); //Load System $load_average = sys_getloadavg(); //Date & Time @@ -100,91 +103,122 @@ $hdd_devices_mount = explode("\n", trim($hdd_result)); $usb_result = shell_exec("lsusb"); $usb_devices_mount = explode("\n", trim($usb_result)); -// Client ---------------------------------------------------------- -echo '