[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-developers] raq4 memory problem... in php
- Subject: Re: [cobalt-developers] raq4 memory problem... in php
- From: "John P. Looney" <valen@xxxxxxxxxx>
- Date: Tue Aug 20 06:56:03 2002
- List-id: Discussion Forum for developers on Sun Cobalt Networks products <cobalt-developers.list.cobalt.com>
On Tue, Aug 20, 2002 at 03:40:08PM +0200, ToPPi mentioned:
> it would be nice to run this in a php script..
> has anyone of you an idea how to run the commands below in an php script and
> show the result there?
>
> > #!/bin/sh
> > physical=`grep Mem: /proc/meminfo | awk '{print $2}'`
> > used=`grep Mem: /proc/meminfo | awk '{print $3}'`
> > buffers=`grep Mem: /proc/meminfo | awk '{print $6}'`
> > cache=`grep Mem: /proc/meminfo | awk '{print $7}'`
> > swapused=`grep Swap: /proc/meminfo | awk '{print $3}'`
> > echo $(( $physical - $used + $cache + $buffers - $swapused ))
Hmm. A challenge.
<?
$physical=`grep Mem: /proc/meminfo | awk '{print $2}'`;
$used=`grep Mem: /proc/meminfo | awk '{print $3}'`;
$buffers=`grep Mem: /proc/meminfo | awk '{print $6}'`;
$cache=`grep Mem: /proc/meminfo | awk '{print $7}'`;
$swapused=`grep Swap: /proc/meminfo | awk '{print $3}'`;
echo $physical - $used + $cache + $buffers - $swapused;
?>
Kinda similar, no ?
Kate, the multiskilled admin