Its's been a while since I've written ASN.1 so..
Our data model is comprised of several table definitions within a table. This is not workable in SNMP, so we need to flatten the definitions. The easiest way to do this would be to have the embedded table indexed by the same OID as the parent table. Thus
someTableEntry ::= SEQUENCE {
someTableIndex
Integer32,
someTableDomain
Integer32,
someTableFooTable
SEQUENCE OF SomeTableFooTable
}
becomes
someTableEntry ::= SEQUENCE {
someTableIndex
Integer32,
someTableDomain
Integer32,
}
someTableFooTable ::= SEQUENCE {
someTableIndex
Integer32,
....
}
The good thing is that in our application there will NEVER be any kind of SET, GET or GET NEXT so no need for SNMP walk (there are some very good reasons for this that supersede the need for network management elegance. All attributes will be reported via traps only. I think this is a valid SNMP MIB definitions but wanted to get some feedback.
Thanks in advance.
It sounds like you're on the right track. In order to define a table as a child of another table, you simply index it by the parent's index plus the child's index (e.g.,
0.1.8.23.7.2.42
where2
is the parent index and42
is the child index).For example, you could define a parent like:
With a child table defined as:
Note that it's not necessary to list parentIndex in the ChildEntry sequence since it's already be declared elsewhere in the MIB.
This method works well and it even responds to snmp walks without issue.
Once you have a MIB that you think accurately defines the structure you want, you can validate it using
smilint
if you are on a linux machine or have cygwin installed or you can validate it online.Update
This pattern will work for deeper nesting as well.
A grandchild table could be defined as:
The only limit on nesting depth is the maximum OID length (which, I believe, is 127): A column's base OID length plus the number of indices for the table must be less than the maximum OID length.
One other item to note is that at each level there can be multiple siblings.
A second child could be defined as: