Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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., <code>0.1.8.23.7.2.42</code> where <code>2</code> is the parent index and <code>42</code> is the child index).</p> <p>For example, you could define a parent like:</p> <pre><code>parentTable OBJECT-TYPE SYNTAX SEQUENCE OF parentEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Parent table" ::= { example 1 } parentEntry OBJECT-TYPE SYNTAX ParentEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Entry in Parent table" INDEX { parentIndex } ::= { parentTable 1 } ParentEntry ::= SEQUENCE { parentIndex Unsigned32, -- other columns in the table } -- define the columns in the parent table </code></pre> <p>With a child table defined as:</p> <pre><code>childTable OBJECT-TYPE SYNTAX SEQUENCE OF childEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Child table" ::= { example 2 } childEntry OBJECT-TYPE SYNTAX ChildEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Entry in Child table" INDEX { parentIndex, childIndex } ::= { childTable 1 } ChildEntry ::= SEQUENCE { childIndex Unsigned32, -- other columns in the table } -- define the columns in the child table </code></pre> <p>Note that it's not necessary to list parentIndex in the ChildEntry sequence since it's already be declared elsewhere in the MIB.</p> <p>This method works well and it even responds to snmp walks without issue.</p> <p>Once you have a MIB that you think accurately defines the structure you want, you can validate it using <a href="http://www.ibr.cs.tu-bs.de/projects/libsmi/smilint.html" rel="noreferrer"><code>smilint</code></a> if you are on a linux machine or have cygwin installed or you can <a href="http://www.ibr.cs.tu-bs.de/projects/libsmi/tools/" rel="noreferrer">validate it online</a>.</p> <p><strong>Update</strong></p> <p>This pattern will work for deeper nesting as well.</p> <p>A grandchild table could be defined as:</p> <pre><code>grandChildTable OBJECT-TYPE SYNTAX SEQUENCE OF grandChildEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Grandchild table" ::= { example 3 } grandChildEntry OBJECT-TYPE SYNTAX GrandChildEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Entry in Grandchild table" INDEX { parentIndex, childIndex, grandChildIndex } ::= { grandChildTable 1 } grandChildEntry ::= SEQUENCE { grandChildIndex Unsigned32, -- other columns in the table } -- define the columns in the grandChild table </code></pre> <p>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.</p> <p>One other item to note is that at each level there can be multiple siblings.</p> <p>A second child could be defined as:</p> <pre><code>secondchildTable OBJECT-TYPE SYNTAX SEQUENCE OF secondchildEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Second child table" ::= { example 4 } secondchildEntry OBJECT-TYPE SYNTAX SecondchildEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "Entry in Second child table" INDEX { parentIndex, secondchildIndex } ::= { secondchildTable 1 } SecondchildEntry ::= SEQUENCE { secondchildIndex Unsigned32, -- other columns in the table } -- define the columns in the second child table </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload