OBJECT-TYPE
OBJECT-TYPE is the macro used to define a single manageable data point inside a MIB - almost everything you can actually query over SNMP is defined this way. If a MIB has a hundred queryable values, it has roughly a hundred OBJECT-TYPE definitions, one per value.
A typical definition
ifDescr OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A textual string containing information about the
interface."
::= { ifEntry 2 }
Every field here is doing real work:
- SYNTAX - the data type. Could be a basic ASN.1 type (
INTEGER,OCTET STRING) or a textual convention likeDisplayStringthat adds meaning and formatting rules on top of a basic type. - MAX-ACCESS - whether this object can only be read, or also written via SET. Common values are
read-only,read-write,read-create(for table rows that can be created via SET), andnot-accessible(used for objects that exist structurally, like a table's own entry, but aren't themselves queryable). - STATUS - whether the object is
current,deprecated(still works, but shouldn't be used in new implementations), orobsolete(no longer expected to be supported at all). - DESCRIPTION - a plain-English explanation of what the object actually represents. This is often the single most useful field for a human trying to understand an unfamiliar OID.
- ::= { ifEntry 2 } - the object's position in the OID tree, defined relative to its parent (here, the 2nd child of
ifEntry) rather than as a full absolute number - the actual numeric OID gets resolved by walking up the chain of parent definitions.
Scalars vs. table columns
An OBJECT-TYPE can define either a standalone scalar value (something with exactly one instance, queried with a trailing .0) or a column within a table (queried with an instance index identifying which row). The definition itself doesn't look dramatically different either way - what makes something a table column is really whether its parent in the OID tree is a SEQUENCE-typed row entry, itself part of a larger table structure.
Why this format matters for tooling
Because every queryable object follows this same structured format, MIB-parsing tools (including MIB Viewer) can reliably extract a name, data type, access level, and description for any object, across every vendor and every MIB, without needing custom logic per MIB. That consistency is really what makes MIB-based tooling possible at all - it's a shared, machine-parseable format underneath what would otherwise just be vendor-specific documentation.