diff --git a/includes/functions.php b/includes/functions.php index eb76ffca..9d12869d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -673,103 +673,6 @@ function DisplayTorProxyConfig(){ 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
-
-
% -
-
-
-
-
-
- -
- - - -
- -
-
-
- - 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
+
+
% +
+
+
+
+
+
+ +
+ + + +
+ +
+
+
+ + diff --git a/index.php b/index.php index 2b066bef..f1fa7e6d 100755 --- a/index.php +++ b/index.php @@ -43,6 +43,7 @@ include_once( 'includes/authenticate.php' ); include_once( 'includes/admin.php' ); include_once( 'includes/dhcp.php' ); include_once( 'includes/hostapd.php' ); +include_once( 'includes/system.php' ); $output = $return = 0; $page = $_GET['page'];