sigar/bindings/php/examples/free.php
2007-09-05 04:19:11 +00:00

21 lines
411 B
PHP

<?php
$sigar = new Sigar();
$mem = $sigar->mem();
$swap = $sigar->swap();
echo "\tTotal\tUsed\tFree\n";
echo "Mem: " .
($mem->total() / 1024) . "\t" .
($mem->used() / 1024) . "\t" .
($mem->free() / 1024) . "\n";
echo "Swap: " .
($swap->total() / 1024) . "\t" .
($swap->used() / 1024) . "\t" .
($swap->free() / 1024) . "\n";
echo "RAM: " . $mem->ram() . "MB\n";