[mrtg] Correct way to do Target math?

Ray Van Dolson rvandolson at esri.com
Wed Jul 25 02:43:03 CEST 2007


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.

I would like to graph this and also memTotalReal.0.  I am having a hard
time figuring out the right way to do this however... I am currently
using:

  Target[memory_used]: memTotalReal.0&memTotalReal.0:public at localhost -
    memBuffer.0&memIndex.0:public at localhost -
    memCached.0&memIndex.0:public at localhost -
    memAvailReal.0&memIndex.0:public at localhost

(Pardon the word wrapping).  memIndex.0 evaluates to 0 so that my
second variable doesn't continue to get subtracted.

Is there a better way to do this?  I tried doing something like:

  memTotalReal.0&memTotalReal.0:<stuff> - memBuffer.0&0:<stuff> ....

But this doesn't evaluate.  Other than the first group, I just want the
second half of the & statement to be 0.

TIA,
Ray



More information about the mrtg mailing list