Grouping Columns in MIBs for SNMP

155 Views Asked by At

I have a table in SNMP like this:

Id    Name    A.x   A.y   B.x  B.y
1     Test     1     2     1    3
2     Next     3     4     5    6

I can make this accessible using SNMP as

table.1.1 = 1             table.1.2 = 2
table.2.1 = Name          table.2.2 = Next
table.3.1 = 1             table.3.2 = 3
table.4.1 = 2             table.4.2 = 4
table.5.1 = 1             table.5.2 = 5
table.6.1 = 3             table.6.2 = 6

So the assignment of columns would be

1 = Id   2 = Name   3 = A.x   4 = A.y   5 = B.x   6 = B.y

However for some reasons (such as being able to add A.z and B.z later on in the "right order"), I want to have the columns as follows:

1 = Id   2 = Name   3.1 = A.x   3.2 = A.y   4.1 = B.x   4.2 = B.y

My data would then look like this:

table.1.1 = 1             table.1.2 = 2
table.2.1 = Name          table.2.2 = Next
table.3.1.1 = 1           table.3.1.2 = 3
table.3.2.1 = 2           table.3.2.2 = 4
table.4.1.1 = 1           table.4.1.2 = 5
table.4.2.1 = 3           table.4.2.2 = 6

Basically SNMP (which only requires that all data can be iterated over with some start OID for every column and has no further internal rules for tables) allows that.

However can it be expressed in MIBs?

Are clients able to handle that?

2

There are 2 best solutions below

1
On

You can do whatever you want. But, if you want to obey the "Structure of Management Information" standard RFC 2578, then section 7.1.12 Conceptual Tables at

https://www.rfc-editor.org/rfc/rfc2578#section-7.1.12

explains the rules that you already know. Most apps will not know your ad-hoc table layout.

0
On

The assignments you propose, where some of your columnar objects are not direct sub-nodes of the row but instead have an intermediate sub-node between them, are not legal. The relevant rules are defined in RFC 2578 section 7.10(2), Mapping of the OBJECT-TYPE value:

(2) If the object corresponds to a conceptual row, then at least one assignment, one for each column in the conceptual row, is present beneath that object. The administratively assigned name for each column is derived by appending a unique, positive sub-identifier to the administratively assigned name for the conceptual row.

Emphasis mine. The meaning is clear: your columns' OIDs must be assigned by a single subidentifier appended to the row's OID (note that "name" means OBJECT IDENTIFIER value. The textual label one tends to think of as a name is called a "descriptor".)