Where are stored SNMP MIB OID values and accsess type for every OID, that specified in MIB file, in Linux-based embedded systems? (such as networking equipment, set-top boxes, machine control, industrial automation) There should be internal database to store all these OID MIB values, names, Access types internally.
2 Answers
There are generally a number of ways that data exists and is accessed by the snmp agent:
1) The agent's internal memory, usually just for configuring and monitoring the agent itself
2) The agent performs system calls to query the local device/software to look up the information it needs. EG, when you request the uptime of the machine from the HOST-RESOURCES-MIB then the agent will determine that by asking the kernel (via an API or via a /proc like filesystem or...)
3) The agent communicates with something else through some RPC like mechanism. One such mechanism is the AgentX protocol, which is a master-agent to sub-agent protocol that is a subset of SNMP for use on a local system. Sub-agents register with the master agent indicating they want to offer up service for some portion of the MIB tree.
Basically, it's very rare that the agent itself knows the data. It almost always has to go ask something else on the system for the information to report.

- 21,735
- 2
- 38
- 69
-
=> 3) so SNMP agent makes a request to master-agent via AgentX protocol and ask it for MIB variable value? The master agent run on a local device/system, or on the remote? Where is stored the MIB tree itself? – Apr 09 '14 at 19:49
-
The agentx protocol isn't designed to run securely, so it really needs to be on the same system. If you need it to be on a different system, you can use an SNMP proxy instead. (Net-SNMP supports it; see the proxy section of the snmpd.conf file). – Wes Hardaker Apr 10 '14 at 20:29
Generally speaking for net-snmp based agents, the object definitions are used to generate C source files which finally are built and linked into the SNMP agent, snmpd. I did not read all the source code of net-snmp but I doubt if an internal database is used.

- 60,503
- 9
- 116
- 147