1
votes

We are implementing support for the Entity MIB module (RFC 6933) and related MIB modules as part of an SNMP agent (snmpd) using Net-SNMP.

Some of the data is shared between MIB tables and MIB modules, for example table indices and "contained in" objects between entPhysicalTable and entPhysicalContainsTable, and indices between entPhysicalTable and entPhySensorTable.

Note that MIB modules related to the Entity MIB module include the Entity Sensor and Entity Battery MIB modules (RFCs 3433 and 7577 respectively).

Are there any pointers or best practices on how to enable such sharing of data between tables using Net-SNMP?

Is there any built-in support provided by Net-SNMP to achieve this, e.g. any particular mib2c options to construct the relevant template source files for these MIB tables?

In particular, data such as indices needs to be dynamic, as entities such as Field-Replaceable Units (FRUs) may be added or removed whilst an SNMP agent is running.

I note that data (indices) is shared between tables such as ifTable and ifXtable, provided as part of the standard Net-SNMP implementation.

Thanks in advance for any help.

1

1 Answers

0
votes

When you run mib2c and specify a table, and don't specify a configuration file, it will ask you questions about the style of code you want to generate. Generally speaking, the choices boil down to whether you want net-snmp to "own" the underlying data store (which you update as values change) or whether you will use your own data structures for the underlying data store (which you will implement hooks to that net-snmp calls to interact with your data). In the former case, net-snmp would handle this "shared data" because it owns it. In the latter case, how you handle it depends on how you organize your data structures.