+ First commit (version 2.0)

This commit is contained in:
ShevAbam
2014-06-18 10:11:11 +02:00
commit 20705a550d
33 changed files with 3672 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
require 'Utils/Misc.class.php';
// Free
if (!($free = shell_exec('grep MemFree /proc/meminfo | awk \'{print $2}\'')))
{
$free = 0;
}
// Total
if (!($total = shell_exec('grep MemTotal /proc/meminfo | awk \'{print $2}\'')))
{
$total = 0;
}
// Used
$used = $total - $free;
// Percent used
$percent_used = 100 - (round($free / $total * 100));
$datas = array(
'used' => Misc::getSize($used * 1024),
'free' => Misc::getSize($free * 1024),
'total' => Misc::getSize($total * 1024),
'percent_used' => $percent_used,
);
echo json_encode($datas);