The demo_module_10 code is located by default in /usr/demo/sma_snmp/demo_module_10. The README_demo_module_10 file within that directory contains instructions that tell how to perform the following tasks:
Compile source files to generate a shared library object that implements a module
Set up the agent to dynamically load the module
Test the module with snmp commands to show that the module is functioning as expected
The demo_module_10 example implements the objects defined in the SDK-DEMO10-MIB.txt. The module is designed to handle long-running data collections so that their values can be polled by an SNMP manager. The module also shows how to implement objects that normally would block the agent as the agent waits for external events. The agent can continue responding to other requests while this implementation waits.
The demo_module_10 module uses the following features:
Sets the delegated member of the requests structure to 1 to indicate to the agent that this request should be delayed. The agent queues this request to be handled later and then is available to handle other requests. The agent is not blocked by this request.
Registers an SNMP alarm to update the results at a later time.
Uses status variable to communicate the status of a data collection to the polling SNMP manager.
Uses refreshTime variable to return the date and time that the data collection completed.