Agent Architecture
From Net-SNMP Wiki
The Net-SNMP agent is responsible for handling incoming requests (passed to it from the library's transport and processing layers). This page describes how the agent works internally.
Startup
Upon starting, the agent goes through the following steps (in SnmpDaemonMain()):
- reads command line options
- decides whether it's a master or subagent
- calls init_agent()
- initializes the mib-module registration tree
- registers its own configuration file tokens and callbacks
- initializes the Agent Helpers
- initializes all the compiled-in mib modules
- initializes the base libnetsnmp library
- opens all the required ports to listen on
- forks
- saves persistent data (it's likely at least something has changed already)
- sends a coldStart trap
- invokes receive() to perform the main packet handling