hillel_guy
hillel_guy

Reputation: 696

SNMP table with dynamic number of columns

I want to have a SNMP table with dynamic number of rows and columns. The code which creates the OIDs in the snmpd is ready but now I'm having problems with the MIB file.

The MIB file allows dynamic number of rows(entries) but must have constant number of columns.

I'm looking for a way to solve this problem. The following solutions may be possible but I don't know if they are available on the MIB file:

  1. The number of columns is between 1-32. If I could define the columns to be optional - it would solve my problem.
  2. Having dynamic number of tables: If I could define Template table which will have Template name and OID, this will allow me to split my table to smaller dynamic tables with static number of columns.

Currently I can't find any record of such solutions.

Upvotes: 1

Views: 2338

Answers (1)

Jolta
Jolta

Reputation: 2725

SNMP does not allow a dynamic number of columns in a table. It requires that the MIB describes the table completely, so that a manager knows which columns are present, before trying to contact the agent.

Defining tables dynamically is also not permitted.

If you edit your question to describe the data you are trying to model, perhaps we could figure out whether or not it's possible to model it in a MIB. I can certainly imagine situations where the capabilities of SNMP are insufficient to model a data set. It works best where data is either scalar, a tree, or a table with a fixed set of columns.

Edit: As k1eran posted in a comment, it is possible to simply not populate some columns with data, leaving a "sparse table". Please see his comment for a link.

Upvotes: 4

Related Questions