Display CPU and I/O utilization of the last one, five, and 15 minute periods (load).

This commit is contained in:
DL6ER
2016-11-09 17:07:05 +01:00
parent 383ea1f365
commit 249e3443a9
+15
View File
@@ -11,6 +11,9 @@
$cmd = "echo $((`cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2`))";
$output = shell_exec($cmd);
$output = str_replace(array("\r\n","\r","\n"),"", $output);
// Get load
$loaddata = sys_getloadavg();
?>
<!DOCTYPE html>
@@ -154,6 +157,18 @@
echo '<a href="#"><i class="fa fa-fire" style="color:#3366FF"></i> Temp: ' . $output . '</a>';
}
?>
<br/>
<?php
echo '<a href="#"><i class="fa fa-circle" style="color:';
if ($loaddata[0] > 2.0) {
echo '#FF0000';
}
else
{
echo '#3366FF';
}
echo '""></i> Load:&nbsp;&nbsp;' . $loaddata[0] . '&nbsp;&nbsp;' . $loaddata[1] . '&nbsp;&nbsp;'. $loaddata[2] . '</a>';
?>
</div>
</div>
<!-- sidebar menu: : style can be found in sidebar.less -->