[mrtg] How to perform calculation for single and double values

Sancho2k.net Lists lists at sancho2k.net
Mon Mar 21 05:44:27 MET 2005

I want to graph measurements of memory on my systems using values of 
"total memory" and "used memory" from SNMP. I have "memTotalReal" and 
"memAvailReal" that I'd like to work with, except that memAvailReal is 
free memory and I want used. So I would like to use the difference of 
total memory minus available memory to calculate the used memory. I 
tried the following target line which does not work:

memTotalReal.0:public at molodetz.sancho2k.net&memTotalReal.0:public at molodetz.sancho2k.net 
- memAvailReal.0:public at molodetz.sancho2k.net

The error that I get is:

ERROR: Target[molodetz.sancho2k.net_usedmem][_OUT_] 'memTotalReal. 
$target->[4]{$mode} . $target->[3]{$mode}  - memAvailReal. 
$target->[5]{$mode} ' (eval): Bareword "memTotalReal" not allowed while 
"strict subs" in use at (eval 9) line 1.
Bareword "memAvailReal" not allowed while "strict subs" in use at (eval 
9) line 1.

So I guess there's a problem with the way I've structured this. I want 
the In value to be memTotalReal.0 and the Out value to be 
(memTotalReal.0 - memAvailReal.0).



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