Creating a Subagent Using the eSNMP API
3.2 The Structure of Management Information
For example, the chess MIB provided with the sample code in the
[TCPIP$EXAMPLES.SNMP] directory has an element with the name ‘‘chess.’’
The OID for the element chess is 1.3.6.1.4.1.36.2.15.2.99, which is derived from
its position in the hierarchy of the tree:
iso(1)
org(3)
dod(6)
internet(1)
private(4)
enterprise(1)
digital(36)
ema(2)
sysobjects(15)
decosf(2)
chess(99)
Any node in the MIB hierarchy can define a MIB subtree. All elements in the
subtree have an OID that starts with the OID of the subtree base. For example,
if you define chess to be a MIB subtree base, the elements with the same prefix
as the chess OID are all in the MIB subtree:
chess
1.3.6.1.4.1.36.2.15.2.99
chessProductID
1.3.6.1.4.1.36.2.15.2.99.1
chessMaxGames
1.3.6.1.4.1.36.2.15.2.99.2
chessNumGames
1.3.6.1.4.1.36.2.15.2.99.3
gameTable
1.3.6.1.4.1.36.2.15.2.99.4
gameEntry
1.3.6.1.4.1.36.2.15.2.99.4.1
gameIndex
1.3.6.1.4.1.36.2.15.2.99.4.1.1
gameDescr
1.3.6.1.4.1.36.2.15.2.99.4.1.2
gameNumMoves
1.3.6.1.4.1.36.2.15.2.99.4.1.3
gameStatus
1.3.6.1.4.1.36.2.15.2.99.4.1.4
moveTable
1.3.6.1.4.1.36.2.15.2.99.5
moveEntry
1.3.6.1.4.1.36.2.15.2.99.5.1
moveIndex
1.3.6.1.4.1.36.2.15.2.99.5.1.1
moveByWhite
1.3.6.1.4.1.36.2.15.2.99.5.1.2
moveByBlack
1.3.6.1.4.1.36.2.15.2.99.5.1.3
moveStatus
1.3.6.1.4.1.36.2.15.2.99.5.1.4
chessTraps
1.3.6.1.4.1.36.2.15.2.99.6
moveTrap
1.3.6.1.4.1.36.2.15.2.99.6.1
The base of this MIB subtree is registered with the master agent to tell it that
this subagent handles all requests related to the elements in the subtree.
The master agent expects a subagent to handle all objects subordinate to the
registered MIB subtree. This principle guides your choice of MIB subtrees.
For example, registering a subtree of chess is reasonable because it is realistic
to assume that the subagent could handle all requests for elements in this
subtree. Registering an entire application-specific MIB usually makes sense
because the particular application expects to handle all objects defined in the
application-specific MIB.
However, registering a subtree of SNMP (under MIB II) would be a mistake,
because it is unlikely that the subagent is prepared to handle every defined MIB
object subordinate to SNMP (packet counts, errors, trapping, and so on).
A subagent can register as many MIB subtrees as it wants. It can register OIDs
that overlap with other registrations by itself or with other subagents; however,
it cannot register the same OID more than once. Subagents can register and
unregister MIB subtrees at any time after communication with the master agent
is established.
3–4 Creating a Subagent Using the eSNMP API