mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2024-11-15 21:01:46 -05:00
Fixed memory datas on Arch #15
This commit is contained in:
parent
3ed4c1d633
commit
086a1829e6
@ -245,7 +245,7 @@ $update = $Config->checkUpdate();
|
||||
<table class="firstBold">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="w20p">Used</td>
|
||||
<td class="w20p">Used %</td>
|
||||
<td><div class="progressbar-wrap"><div class="progressbar" style="width: 0%;">0%</div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -277,7 +277,7 @@ $update = $Config->checkUpdate();
|
||||
<table class="firstBold">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="w20p">Used</td>
|
||||
<td class="w20p">Used %</td>
|
||||
<td><div class="progressbar-wrap"><div class="progressbar" style="width: 0%;">0%</div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user