SNMP Subagent Programmer's Guide

Encoding MIBs
3-16 119728SNMP Subagent Programmer’s Guide
Writing and Compiling MIBs
The trap, tableTrap, contains three variable bindings, one for each of the table entry
objects; refer to the following subsection, “Trap Definitions,for information on
defining traps:
tableTrap TRAP-TYPE
ENTERPRISE tblTrap
VARIABLES { cardNumber, portNumber, ratio }
DESCRIPTION
"This trap is generated whenever a legal card
and port combination is provided to the program."
::= 0
Trap Definitions
Trap definitions are encoded as specified in RFC 1215. There are no extensions to the
standard definition conventions. Access methods that would normally be used for Get
access to MIB objects in the VARIABLES lists are invoked to retrieve values to include
in the trap. If the MIB objects in the trap definition are indexed variables and you do not
register every entry, you should associate them with next and locator functions so that
the correct table entry can be selected when the trap is generated.
Syntax
A trap definition has these components.
trap-name
is a logical name for the trap.
ENTERPRISE object-identifier
identifies the management enterprise under whose registration authority the trap is
defined.
VARIABLES "{" MIB-object-name [,MIB-object-name...]"}"
defines the sequence in which MIB objects in the trap are ordered. Each MIB object
named must have been defined earlier in your MIB definition.
DESCRIPTION "description-text"
is an optional clause for documenting the semantics of the trap. Although this
clause is optional, you should always provide one. The description is visible to
manager users, who need to understand the meaning of your subagent’s traps.
trap-name TRAP-TYPE
ENTERPRISE object-identifier
[VARIABLES "{" MIB-object-name [,MIB-object-name...]"}"]
[DESCRIPTION "description-text"]
[REFERENCE "reference-text"]
::= trap-number