[mrtg] Correct way to do Target math?

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Jul 25 17:05:13 CEST 2007


On Wed, Jul 25, 2007 at 08:41:27AM -0600, Eric Brander wrote:
> On 7/24/07, Ray Van Dolson <rvandolson at esri.com> wrote:
> > I'm trying to generate a graph using SNMP of actual memory used on a
> > Linux system running Net-SNMP.  In theory:
> >
> >   memTotalReal.0 - memBuffer.0 - memCached.0 - memAvailReal.0
> >
> > Is the real memory available.
> 
> 
> Are you sure about that? Why would subtracting memAVAILreal from
> memTOTALreal equal the real memory available? Seems that would give
> you memory in use. But then why subtract the buffer and cached?

linux will use available memory for buffers and cache, but only
if this memory is not needed for other tasks.

If you want to start a program, or if a program needs memory, then
memory used by linux for buffers and cache _is_ available.

In other words:
Available_memory = (memBuffer+memCached+memAvailReal)
Memory_really_in_use_for_programs = memTotalReal - available_memory


> Maybe I don't understand those counters but that just doesn't jive in
> my brain. Also, are these really counters or are they gauges?

They are numbers.  Usually you would input them in mrtg or rrdtool
as type gauge, which means you'd process them as if they were rates.
That doesn't mean they _are_ rates though.


-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the mrtg mailing list