sigar/bindings/php/examples/free.php

21 lines
411 B
PHP
Raw Normal View History

2007-09-05 12:19:11 +08:00
<?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";