diff --git a/front/systeminfo.php b/front/systeminfo.php index 5884bcbd..1876ce3b 100644 --- a/front/systeminfo.php +++ b/front/systeminfo.php @@ -64,8 +64,9 @@ 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 = shell_exec('cat /sys/class/hwmon/hwmon0/temp1_input'); // Get the CPU temperature $cpu_temp = floatval($cpu_temp) / 1000; // Convert the temperature to degrees Celsius +$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 = number_format($total_memorykb, 0, '.', '.'); @@ -204,18 +205,46 @@ echo '

CPU

+
+
CPU Vendor:
+
' . $cpu_vendor . '
+
CPU Name:
' . $stat['cpu_model'] . '
CPU Cores:
-
' . $stat['cpu'] . ' @ ' . $stat['cpu_frequ'] . ' MHz
+
' . $stat['cpu'] . '
+
+
CPU Speed:
+
' . $stat['cpu_frequ'] . ' MHz
+
CPU Temp:
'. $cpu_temp .' °C
-
+
'; + // Get the number of CPU cores + $num_cpus = $stat['cpu']; + $num_cpus = $num_cpus +2; + + // Iterate over the CPU cores + for ($i = 2,$a = 0; $i < $num_cpus; $i++,$a++) { + + // Get the CPU temperature + $cpu_tempxx = shell_exec('cat /sys/class/hwmon/hwmon0/temp' . $i . '_input'); + + // Convert the temperature to degrees Celsius + $cpu_tempxx = floatval($cpu_tempxx) / 1000; + + // Print the CPU temperature + echo '
+
CPU Temp ' . $a . ':
+
' . $cpu_tempxx . ' °C
+
'; + } + echo ' ';