Doesn't seem to... eg v 2c linkUp rubydebug output shown here...
https://www.rfc-editor.org/rfc/rfc3416#page-21
4.2.6. The SNMPv2-Trap-PDU
... The first
** two variable bindings** in the variable binding list of an SNMPv2-
Trap-PDU are sysUpTime.0 [RFC3418] and snmpTrapOID.0 [RFC3418]
respectively. If the OBJECTS clause is present in the invocation of
the corresponding NOTIFICATION-TYPE macro, then each corresponding
** variable**, as instantiated by this notification, is copied, in order,
to the variable-bindings field. ...
In the rudydebug codec output:
...
"@metadata" => {
"input" => {
"snmptrap" => {
"pdu" => {
"type" => "TRAP",
"error_index" => 0,
"variable_bindings" => {
"1.3.6.1.2.1.1.3.0" => 3310491537,
"1.3.6.1.2.1.2.2.1.8" => 1,
"1.3.6.1.2.1.2.2.1.1" => 16,
"1.3.6.1.6.3.1.1.4.1.0" => "iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTraps.linkUp",
"1.3.6.1.2.1.2.2.1.7" => 1
},
"error_status_text" => "Success",
"error_status" => 0,
"version" => "2c",
"community" => "public",
"request_id" => 17314
}
}
}
},
...
"message" => "{\"error_index\":0,\"variable_bindings\":{\"1.3.6.1.2.1.2.2.1.7\":1,\"1.3.6.1.2.1.2.2.1.8\":1,\"1.3.6.1.2.1.2.2.1.1\":16,\"1.3.6.1.6.3.1.1.4.1.0\":\"iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTraps.linkUp\",\"1.3.6.1.2.1.1.3.0\":3310491537},\"error_status\":0,\"type\":\"TRAP\",\"error_status_text\":\"Success\",\"community\":\"public\",\"version\":\"2c\",\"request_id\":17314}"
...
The varbinds in [@metadata][input][snmptrap][pdu][variable_bindings] in the output above is out-of-order: (the order in "message" seems totally different again)
(sysUpTimeInstance,
ifOperStatus
ifIndex,
snmpTrapOID,
ifAdminStatus)
whereas in IF-MIB:
linkUp NOTIFICATION-TYPE
OBJECTS { ifIndex, ifAdminStatus, ifOperStatus }
STATUS current
DESCRIPTION
"A linkUp trap...."
::= { snmpTraps 4 }
Is there any way to enforce the order of the varbinds so that I can create various field-value processing based on the varbinds defined position?
Thanks.