From 663a6612376dc60d07239c5ace213155b75b83d3 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Mon, 9 Oct 2017 08:57:25 +0000 Subject: [PATCH] Fix load average display value, this is not a percentage made out the three values (@see man proc). --- ajax.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ajax.php b/ajax.php index d3af3ed..8bfcb31 100644 --- a/ajax.php +++ b/ajax.php @@ -195,8 +195,9 @@ if ($_GET['section'] == "sysinfo") { } $output = shell_exec('cat /proc/loadavg'); - $sysload = substr($output,0,strpos($output," "))*100; - showLapTime("sysload"); + $loadavg = explode(" ", $output); + $sysload = $loadavg[0] . " / " . $loadavg[1] . " / " . $loadavg[2]; + Showlaptime("sysload"); $stat1 = file('/proc/stat'); sleep(1); $stat2 = file('/proc/stat'); @@ -268,7 +269,7 @@ if ($_GET['section'] == "sysinfo") { - % +