diff --git a/app/system/resources/dashboard/system_status.php b/app/system/resources/dashboard/system_status.php index 806d408d47..98e8d4a4ce 100644 --- a/app/system/resources/dashboard/system_status.php +++ b/app/system/resources/dashboard/system_status.php @@ -24,7 +24,18 @@ $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; - echo "".$text['label-system_status'].""; + //cpu usage + if (stristr(PHP_OS, 'Linux')) { + $result = shell_exec('ps -A -o pcpu'); + $percent_cpu = 0; + foreach (explode("\n", $result) as $value) { + if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; } + } + $result = trim(shell_exec("grep -P '^processor' /proc/cpuinfo")); + $cores = count(explode("\n", $result)); + if ($percent_cpu > 1) { $percent_cpu = $percent_cpu / $cores; } + $percent_cpu = round($percent_cpu, 2); + } //disk usage if (PHP_OS == 'FreeBSD' || PHP_OS == 'Linux') { @@ -37,14 +48,130 @@ } if ($percent_disk_usage != '') { - echo "".$percent_disk_usage.""; - echo "".$text['label-disk_usage']." (%)\n"; + echo " +
| ".$text['label-item']." | \n"; @@ -122,15 +249,6 @@ //cpu usage if (stristr(PHP_OS, 'Linux')) { - $result = shell_exec('ps -A -o pcpu'); - $percent_cpu = 0; - foreach (explode("\n", $result) as $value) { - if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; } - } - $result = trim(shell_exec("grep -P '^processor' /proc/cpuinfo")); - $cores = count(explode("\n", $result)); - if ($percent_cpu > 1) { $percent_cpu = $percent_cpu / $cores; } - $percent_cpu = round($percent_cpu, 2); if ($percent_cpu != '') { echo "
|---|
| ".$text['label-processor_usage']." | \n"; @@ -201,4 +319,4 @@ //} echo " "; -?> \ No newline at end of file +?>