SNMP Subagent Programmer's Guide

Encoding MIBs
3-10 119728SNMP Subagent Programmer’s Guide
Writing and Compiling MIBs
STATUS support-type
assigns a standard SNMP support type to the MIB object. Although the value of
support-type can be one of these four, objects in your MIBs should be assigned the
value mandatory; the other values are of use only in standard MIBs.
DESCRIPTION "object-description"
documents the semantics of the MIB object. Although this clause is optional, you
should always provide one. The object-description is visible to manager station
users, who need to understand the meaning of your subagent’s objects.
REFERENCE "cross-reference"
is an optional clause for documenting the relationship of the MIB object to another
MIB object.
DEFVAL "{"default-value"}"
defines a default value that can be used when the MIB object is created. GDMOC
generates no code for DEFVAL statements: you must provide initialization code in
your subagent logic.
object-name
uniquely identifies the object in the SNMP name hierarchy. It consists of the name
of the subtree in which the MIB object resides and a number for the object, as
described earlier, under “Object Name Definitions.The name of the subtree in
which the MIB object resides can be a MIB name, a group name, or a table entry
name.
Examples
The MIB object named helloOutputText, used in the sample Hello World program, is
defined as follows in the file hellosmi:
helloOutputText OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The textual message that is displayed to stdout
by the Hello World program."
::= { hello 1 }
...
EXTEND OBJECT-TYPE helloOutputText
WITH C_VARIABLE helloText
IN C
mandatory | optional | obsolete | deprecated