[mrtg] Multiple OID's in expression...

David Mitchell mitchelld at sunman.co.uk
Thu Feb 21 12:23:42 MET 2002

I want to calculate the percentage memory usage on a cisco router. There are
2 areas of memory and the figures for memory in use and memory free are
stored in a table.

The table oid is

And the OID's I want to use are: Proc mem in use Proc Mem free IO mem in use IO mem free.

(Proc mem is row 1 in the table, IO mem is row 2, element 5 is memory in
use, element 6 is free memory)

So I want to calculate 100*mem in use / (mem in use + mem free) and use the
Proc mem as the 'in' value and IO mem as the 'out' value so they appear on
the same graph.

The original target I used was:
Target[$target_name]: *
00/( + ) & *100/( + ):routeraddress

I know (and have tried) that I need to add the router address to each OID,
however I cannot get the expression to evaluate, the best I have acheived is
to get a 0 result! Most variations on the target line cause rateup to

I have put debugging on MRTG but it didn't help - I cannot see each variable
being read, just the result of 'getcurrent'.  How is the expression
evaluated in MRTG (Where?) - I am learning enough PERL to be able to
understand some of what is going on.



Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list