Three tables under Sun-specific enterprise MIB OID are defined that facilitate the Solstice Enterprise Agents technology. The following table example is meant to provide manageability of all subagents. The information in this table provides the identity of the subagent. This table contains the subagent name, and the subagent port number. An example of the subtree's OIDs managed by each subagent is not shown.
The following is an example of a MIB containing all types of MIB variables. The MIB also includes tables. When this MIB is run through mibcodegen, it generates the appropriate MIB database and the stub code to build a subagent for this MIB.
DEMO-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE, Counter32, Gauge32
FROM SNMPv2-SMI
DisplayString, TimeStamp
FROM SNMPv2-TC;
mib-2 OBJECT IDENTIFIER ::= { mgmt 1 }
sun OBJECT IDENTIFIER ::= { enterprises 42 }
demo OBJECT IDENTIFIER ::= { sun 1000 }
--
-- Some objects
--
demoString OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"A read-write object of type String."
::= {demo 1}
demoInteger OBJECT-TYPE
::= {demoTable 1}
DemoEntry ::= SEQUENCE {
demoEntryIndex
INTEGER,
demoEntryString
DisplayString,
demoEntryInteger
INTEGER,
demoEntryOid
OBJECT IDENTIFIER }
SYNTAX INTEGER {
up(1),
down(2) }
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"A read-write object of type Integer."
::= {demo 2}
demoOid OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"A read-write object of type Oid."
::= {demo 3}
-- A table composed of some columns
demoTable OBJECT-TYPE
SYNTAX SEQUENCE OF DemoEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A table."
::= {demo 10}
demoEntry OBJECT-TYPE
SYNTAX DemoEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry in the table demoTable."
INDEX {demoEntryIndex}
demoEntryIndex OBJECT-TYPE
SYNTAX INTEGER (1..2147483647)
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An index to uniquely identify the entry."
::= {demoEntry 1}
demoEntryString OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"A read-write column of type String."
::= {demoEntry 2}
demoEntryInteger OBJECT-TYPE
SYNTAX INTEGER {
up(1),
down(2) }
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"A read-write column of type Integer."
::= {demoEntry 3}
demoEntryOid OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"A read-write column of type Oid."
::= {demoEntry 4}
demoTrap TRAP-TYPE
ENTERPRISE sun
VARIABLES { demoInteger, demoString, demoOid}
DESCRIPTION
" Trap for testing."
::= 2
demoColdLinkTrap TRAP-TYPE
ENTERPRISE snmp
DESCRIPTION
" Trap for testing."
::= 0
END