SNMPv2-SMI(7)
π SNMPv2-SMI(7) β MIB section π
okay so bestie, this is the SNMPv2-SMI manual page from the MIB manual, section 7. it's literally the ASN.1 module that defines the Structure of Management Information for SNMPv2. no cap. let's get into the definitions, periodt. π
β¨ the OID tree assignments β¨
first up, we got the root OID assignments. these are like the coordinates of the MIB universe. slay. π
SNMPv2-SMI DEFINITIONS ::= BEGIN
org OBJECT IDENTIFIER ::= { iso 3 }
dod OBJECT IDENTIFIER ::= { org 6 }
internet OBJECT IDENTIFIER ::= { dod 1 }
directory OBJECT IDENTIFIER ::= { internet 1 }
mgmt OBJECT IDENTIFIER ::= { internet 2 }
mib-2 OBJECT IDENTIFIER ::= { mgmt 1 }
transmission OBJECT IDENTIFIER ::= { mib-2 10 }
experimental OBJECT IDENTIFIER ::= { internet 3 }
private OBJECT IDENTIFIER ::= { internet 4 }
enterprises OBJECT IDENTIFIER ::= { private 1 }
security OBJECT IDENTIFIER ::= { internet 5 }
snmpV2 OBJECT IDENTIFIER ::= { internet 6 }
snmpDomains OBJECT IDENTIFIER ::= { snmpV2 1 }
snmpProxys OBJECT IDENTIFIER ::= { snmpV2 2 }
snmpModules OBJECT IDENTIFIER ::= { snmpV2 3 }
π
the MODULE-IDENTITY MACRO π
this macro is giving "define your module's identity" energy. it's got LAST-UPDATED, ORGANIZATION, CONTACT-INFO, DESCRIPTION, and revisions. iconic. π
MODULE-IDENTITY MACRO ::=
BEGIN
TYPE NOTATION ::=
"LAST-UPDATED" value(Update UTCTime)
"ORGANIZATION" Text
"CONTACT-INFO" Text
"DESCRIPTION" Text
RevisionPart
VALUE NOTATION ::=
value(VALUE OBJECT IDENTIFIER)
RevisionPart ::=
Revisions
| empty
Revisions ::=
Revision
| Revisions Revision
Revision ::=
"REVISION" value(Update UTCTime)
"DESCRIPTION" Text
-- uses the NVT ASCII character set
Text ::= """" string """"
END
π¦ the OBJECT-IDENTITY MACRO π¦
next up, object identity. it's got STATUS, DESCRIPTION, and a REFERENCE. the status can be current, deprecated, or obsolete. choose wisely, bestie. π
OBJECT-IDENTITY MACRO ::=
BEGIN
TYPE NOTATION ::=
"STATUS" Status
"DESCRIPTION" Text
ReferPart
VALUE NOTATION ::=
value(VALUE OBJECT IDENTIFIER)
Status ::=
"current"
| "deprecated"
| "obsolete"
ReferPart ::=
"REFERENCE" Text
| empty
Text ::= """" string """"
END
π the base types (all the syntaxes) π
okay so here's where we define all the data types. this is lowkey the main character energy of the whole module. we got ObjectName, NotificationName, ObjectSyntax, SimpleSyntax, Integer32, ApplicationSyntax, IpAddress, Counter32, Gauge32, Unsigned32, TimeTicks, Opaque, and Counter64. let's go. π
ObjectName ::=
OBJECT IDENTIFIER
NotificationName ::=
OBJECT IDENTIFIER
ObjectSyntax ::=
CHOICE {
simple
SimpleSyntax,
-- note that SEQUENCEs for conceptual tables and
-- rows are not mentioned here...
application-wide
ApplicationSyntax
}
SimpleSyntax ::=
CHOICE {
-- INTEGERs with a more restrictive range
-- may also be used
integer-value -- includes Integer32
INTEGER (-2147483648..2147483647),
-- OCTET STRINGs with a more restrictive size
-- may also be used
string-value
OCTET STRING (SIZE (0..65535)),
objectID-value
OBJECT IDENTIFIER
}
Integer32 ::=
[UNIVERSAL 2]
IMPLICIT INTEGER (-2147483648..2147483647)
ApplicationSyntax ::=
CHOICE {
ipAddress-value
IpAddress,
counter-value
Counter32,
timeticks-value
TimeTicks,
arbitrary-value
Opaque,
big-counter-value
Counter64,
unsigned-integer-value -- includes Gauge32
Unsigned32
}
IpAddress ::=
[APPLICATION 0]
IMPLICIT OCTET STRING (SIZE (4))
Counter32 ::=
[APPLICATION 1]
IMPLICIT INTEGER (0..4294967295)
Gauge32 ::=
[APPLICATION 2]
IMPLICIT INTEGER (0..4294967295)
Unsigned32 ::=
[APPLICATION 2]
IMPLICIT INTEGER (0..4294967295)
TimeTicks ::=
[APPLICATION 3]
IMPLICIT INTEGER (0..4294967295)
Opaque ::=
[APPLICATION 4]
IMPLICIT OCTET STRING
Counter64 ::=
[APPLICATION 6]
IMPLICIT INTEGER (0..18446744073709551615)
π₯ the OBJECT-TYPE MACRO π₯
this is the big one. it defines how you describe a managed object. SYNTAX, MAX-ACCESS, STATUS, DESCRIPTION, and more. the Access values are: not-accessible, accessible-for-notify, read-only, read-write, read-create. periodt. π
OBJECT-TYPE MACRO ::=
BEGIN
TYPE NOTATION ::=
"SYNTAX" Syntax
UnitsPart
"MAX-ACCESS" Access
"STATUS" Status
"DESCRIPTION" Text
ReferPart
IndexPart
DefValPart
VALUE NOTATION ::=
value(VALUE ObjectName)
Syntax ::=
type(ObjectSyntax)
| "BITS" "{" Kibbles "}"
Kibbles ::=
Kibble
| Kibbles "," Kibble
Kibble ::=
identifier "(" nonNegativeNumber ")"
UnitsPart ::=
"UNITS" Text
| empty
Access ::=
"not-accessible"
| "accessible-for-notify"
| "read-only"
| "read-write"
| "read-create"
Status ::=
"current"
| "deprecated"
| "obsolete"
ReferPart ::=
"REFERENCE" Text
| empty
IndexPart ::=
"INDEX" "{" IndexTypes "}"
| "AUGMENTS" "{" Entry "}"
| empty
IndexTypes ::=
IndexType
| IndexTypes "," IndexType
IndexType ::=
"IMPLIED" Index
| Index
Index ::=
-- use the SYNTAX value of the
-- correspondent OBJECT-TYPE invocation
value(Indexobject ObjectName)
Entry ::=
-- use the INDEX value of the
-- correspondent OBJECT-TYPE invocation
value(Entryobject ObjectName)
DefValPart ::=
"DEFVAL" "{" value(Defval Syntax) "}"
| empty
-- uses the NVT ASCII character set
Text ::= """" string """"
END
π the NOTIFICATION-TYPE MACRO π
and this one is for notifications. it's got OBJECTS, STATUS, DESCRIPTION, and REFERENCE. so you can tell everyone when something happens. slay. π«Ά
NOTIFICATION-TYPE MACRO ::=
BEGIN
TYPE NOTATION ::=
ObjectsPart
"STATUS" Status
"DESCRIPTION" Text
ReferPart
VALUE NOTATION ::=
value(VALUE NotificationName)
ObjectsPart ::=
"OBJECTS" "{" Objects "}"
| empty
Objects ::=
Object
| Objects "," Object
Object ::=
value(Name ObjectName)
Status ::=
"current"
| "deprecated"
| "obsolete"
ReferPart ::=
"REFERENCE" Text
| empty
-- uses the NVT ASCII character set
Text ::= """" string """"
END
π zeroDotZero and the end π
finally, we got zeroDotZero, which is just a null identifier. and then END. that's the whole module. π
zeroDotZero OBJECT-IDENTITY
STATUS current
DESCRIPTION
"A value used for null identifiers."
::= { 0 0 }
END
that's it bestie! this page was brought to you by Erlang/OTP in the SNMP section, and it's the SNMPv2-SMI(7) manual page. stay iconic. πβ¨
π¦ where this page comes from
- alpine 3.24: erlang28-doc 28.5.0.8-r0 Β· Apache-2.0
- arch rolling: erlang-core 29.1.1-1 Β· Apache-2.0
- nixos 26.05: erlang 29.1.2
- nixpkgs unstable: erlang 29.1.2
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms