Update systeminfo.php

Updated variable "total_memorykb"
Updated variable "total_memorymb"
This commit is contained in:
Carlos V
2023-08-09 02:50:07 +02:00
committed by GitHub
parent 4f59d0867d
commit 2950d2ce9f

View File

@@ -75,8 +75,10 @@ $cpu_temp = floatval($cpu_temp) / 1000; // Convert the temperature to degrees Ce
$cpu_vendor = exec('cat /proc/cpuinfo | grep "vendor_id" | cut -d ":" -f 2' ); // Get the CPU vendor
//Memory stats
$total_memorykb = shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2}'");
$total_memorykb = trim($total_memorykb);
$total_memorykb = number_format($total_memorykb, 0, '.', '.');
$total_memorymb = shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2/1024}'");
$total_memorymb = trim($total_memorymb);
$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);