mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2026-06-03 06:24:38 -04:00
Fixed memory datas on Arch #15
This commit is contained in:
+9
-4
@@ -1,14 +1,19 @@
|
||||
<?php
|
||||
require 'Utils/Misc.class.php';
|
||||
|
||||
// Free
|
||||
if (!($free = shell_exec('/usr/bin/free -to | grep Mem: | awk \'{print $4+$6+$7}\'')))
|
||||
$free = 0;
|
||||
|
||||
if (shell_exec('cat /proc/meminfo'))
|
||||
{
|
||||
$free = 0;
|
||||
$free = shell_exec('grep MemFree /proc/meminfo | awk \'{print $2}\'');
|
||||
$buffers = shell_exec('grep Buffers /proc/meminfo | awk \'{print $2}\'');
|
||||
$cached = shell_exec('grep Cached /proc/meminfo | awk \'{print $2}\'');
|
||||
|
||||
$free = (int)$free + (int)$buffers + (int)$cached;
|
||||
}
|
||||
|
||||
// Total
|
||||
if (!($total = shell_exec('/usr/bin/free -to | grep Mem: | awk \'{print $2}\'')))
|
||||
if (!($total = shell_exec('grep MemTotal /proc/meminfo | awk \'{print $2}\'')))
|
||||
{
|
||||
$total = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user