Suppose I’m writing an SNMP v1/2 agent.
Is it mandatory to append the instance number to the variable OIDs in a trap PDU?
In SNMP V1 for instance a trap is defined in RFC 1157, with these fields:
- Enterprise
- Agent address
- Generic trap type
- Specific trap code
- Time stamp
- Variable bindings
The “variable bindings” section consist of a list of variable names and values.
According to RFC 1157 :
In general, the name of an SNMP
variable is an OBJECT IDENTIFIER of
the form x.y, where x is the name of a
non-aggregate object type defined in
the MIB and y is an OBJECT IDENTIFIER
fragment that, in a way specific to
the named object type, identifies the
desired instance.
What’s bothering me is the “In general”, is the .y mandatory?
Yes, it’s mandatory to include instance subidentifiers for any variable OIDs in the variable bindings. The paragraph is describing the general (i.e., generic) form for a variable OID, not using “in general” to mean a non-committal “well, it’s usually like this, but not always”. Later RFCs use more concrete wording:
[RFC 3416, section 2.1]