[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:
.1.3.6.1.4.1.2352.2.28.1.2.1.12
which corresponds to
.iso.org.dod.internet.private.enterprises.redBackNetworks.rbnMgmt.rbnL2tpMib.rbnL2tpMibObjects.rbnL2tpTunnelCfgTable.rbnL2tpTunnelCfgEntry.rbnL2tpTCfgActSessCnt
(total number of sessions that are presently in the established state)
There's a separate instance value for each L2TP tunnel, such as:
.11732
.35387
.35747
.39342
The MRTG configuration lines would look like this:
Target[blah]:
.1.3.6.1.4.1.2352.2.28.1.2.1.12.11732&.1.3.6.1.4.1.2352.2.28.1.2.1.12.11732:commname at devicename
(etc.)
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
sort):
.1.3.6.1.4.1.2352.2.28.1.2.1.2
which corresponds to
.iso.org.dod.internet.private.enterprises.redBackNetworks.rbnMgmt.rbnL2tpMib.rbnL2tpMibObjects.rbnL2tpTunnelCfgTable.rbnL2tpTunnelCfgEntry.rbnL2tpTCfgTunnelNm
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):
.1.3.6.1.4.1.2352.2.28.1.2.1.3
which corresponds to
.iso.org.dod.internet.private.enterprises.redBackNetworks.rbnMgmt.rbnL2tpMib.rbnL2tpMibObjects.rbnL2tpTunnelCfgTable.rbnL2tpTunnelCfgEntry.rbnL2tpTCfgPeerName
Instance Value
.11732 RBABCDEF01
.35387 RBGHIJKL01
.35747 RBMNOPQR01
.39342 RBSTUVWX01
Is it possible in MRTG to "SNMPwalk" either .1.3.6.1.4.1.2352.2.28.1.2.1.2
(rbnL2tpTCfgTunnelNm) or .1.3.6.1.4.1.2352.2.28.1.2.1.3
(rbnL2tpTCfgPeerName) to dynamically determine each instance value
associated with .1.3.6.1.4.1.2352.2.28.1.2.1.12 (rbnL2tpTCfgActSessCnt) and
use some kind of variable in the OID reference within the MRTG "Target" line
configuration?
Josh
More information about the mrtg
mailing list