File: free.php

package info (click to toggle)
hyperic-sigar 1.6.4%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,256 kB
  • sloc: ansic: 25,873; java: 17,332; perl: 2,670; xml: 801; cs: 621; ruby: 187; python: 47; php: 13; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?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";