1)? 's ':' '); } if ($hours != 0) { $uptime .= $hours . ' hour' . (($hours > 1)? 's ':' '); } if ($minutes != 0) { $uptime .= $minutes . ' minute' . (($minutes > 1)? 's ':' '); } // mem used exec("free -m | awk '/Mem:/ { total=$2 } /buffers\/cache/ { used=$3 } END { print used/total*100}'", $memarray); $memused = floor($memarray[0]); if ($memused > 90) { $memused_status = "danger"; } elseif ($memused > 75) { $memused_status = "warning"; } elseif ($memused > 0) { $memused_status = "success"; } // cpu load $cores = exec("grep -c ^processor /proc/cpuinfo"); $loadavg = exec("awk '{print $1}' /proc/loadavg"); $cpuload = floor(($loadavg * 100) / $cores); if ($cpuload > 90) { $cpuload_status = "danger"; } elseif ($cpuload > 75) { $cpuload_status = "warning"; } elseif ($cpuload > 0) { $cpuload_status = "success"; } ?>
System
System Rebooting Now!
'; $result = shell_exec("sudo /sbin/reboot"); } if (isset($_POST['system_shutdown'])) { echo '
System Shutting Down Now!
'; $result = shell_exec("sudo /sbin/shutdown -h now"); } ?>

System Information

Hostname

Uptime


Memory Used
%
CPU Load
%