[mrtg] Used Memory and Used swap values completed.

Daniel Curry dcurry at dollar.com
Fri Dec 17 20:31:21 MET 1999


Here are the scripts I use to determin Used memory and Used swap on my
digital unix systems.

I hope someone can find them usefull.

  $getmemfreemem = (100 - int((@gotmem[1]/1000000)*100));
  $getmemfreeswp = (100 - int((@gotmem[2]/8000000)*100));

These are the hard parts.

$getmemfreemem = ( 100% - [integer of] ( [returned array element]
divided by [number of total memory blocks]) mulitplied by [100 to get a
value for the perl int function ot work against]));

the free swap is similar but uses the number of blocks that was assigned
to the swap partition upon creation in place of memory blocks.

It might not be pretty, but it works for me.  many thanks to Matthew
Schumacher, schu at 7x.com  -  www.7x.com, who wrote the cpuinfo.pl scripts
that helped create these changes.

If anyone has a better way of doing this, I would love to see it.

and thanks to everyone on this list for being so patient with people
such as myself.

Daniel Curry
Unix System Administrator
Dollar-Rent-A-Car Systems, Inc.
dcurry at dollar.com

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list