Question

I'm developing the agent in SNMP and I have a question related to MIB file: How does the agent get/set the values of object from MIB (I think "MIB" only refers to the definition of objects without values)? How do I manage device handle value of an object from a MIB file?

Was it helpful?

Solution

In order to write a SNMP agent, you have to follow some steps.

  1. List item First define your MIB . In the MIB expose create/set/get operations for different objects. These objects are grouped in a tree.

  2. Write the Parser module that would parse the MIBs and get the data models from them.

  3. Write transport modules, message processor modules and message dispatcher modules.

  4. Adhere to the standard SNMP PDU format when defining the data over the transport (over the Network).

  5. After the message is received from the transport, your Message processing module at the agent side has got to check few things like authentication and authorization (in case of SNMP v3), check for the availability of the OID (check if it is defined in the MIB or not) and other checks if there are any.

If everything is successful then create response PDU and send back with same request Id to the manager which initiated the request.

Check out net-snmp and snmp4j for further ideas on development as you don't have to write everything from the scratch and make use of those freely available libraries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top