[mrtg] Dynamically determine SNMP OID from value of another

Josh Hillman hillman at nettally.com
Sun Sep 2 17:04:52 CEST 2007

Is it possible in MRTG to dynamically reference an SNMP OID based on the 
value of another?

We monitor the following "rbnL2tpTCfgActSessCnt" SNMP OID in our Redback:
which corresponds to
(total number of sessions that are presently in the established state)

There's a separate instance value for each L2TP tunnel, such as:

The MRTG configuration lines would look like this:
. at devicename

Unfortunately, those numbers periodically change--probably when the tunnel 
goes down and is re-established.  Because these numbers change periodically, 
MRTG is no longer able to get data for that particular instance.

The following "rbnL2tpTCfgTunnelNm" OID is the cross-reference between the 
consistant peer name and the inconsistent instance name (an ID of some 
which corresponds to
Each instance is represented like this:
  Instance   Value
  .11732     RBABCDEF01:11732
  .35387     RBGHIJKL01:35387
  .35747     RBMNOPQR01:35747
  .39342     RBSTUVWX01:39342

The first part of each value is the L2TP "peer name" (rbnL2tpTCfgPeerName):
which corresponds to
  Instance   Value
  .11732     RBABCDEF01
  .35387     RBGHIJKL01
  .35747     RBMNOPQR01
  .39342     RBSTUVWX01

Is it possible in MRTG to "SNMPwalk" either . 
(rbnL2tpTCfgTunnelNm) or . 
(rbnL2tpTCfgPeerName) to dynamically determine each instance value 
associated with . (rbnL2tpTCfgActSessCnt) and 
use some kind of variable in the OID reference within the MRTG "Target" line 


More information about the mrtg mailing list