AgenPro provides a built-in simulation agent to facilitate and accelerate SNMP agent development. Without a complete code generation, compilation and agent startup cycle, the simulation agent provides an instant test environment for an early validation of a MIB design.
The simulation agent can simulate scalar and tabular values. In addition, notifications can be sent that use the simulated values. The simulation values and notifications are defined by properties (see “Properties” on page 14).
The simulation values are also used by the SNMP4J-Agent code generation templates to generate initialization code that sets initial values for scalars and creates rows for tables. The so generated code can be used
to implement static MIB data or
as example/template code by programmers to code instrumentation manually.
The simulation agent is also capable of sending notifications (traps). To avoid common errors and misunderstandings, the notification payload is not provided directly/interactively. Instead only the reference to the agent‘s data needs to be specified. This follows the SNMP recommendation trap-directed polling:
SNMP is built around a concept called trap-directed polling. Management applications are responsible to periodically poll SNMP agents to determine their status. In addition, SNMP agents can send traps to notify SNMP managers about events so that SNMP managers can adapt their polling strategy and basically react faster than normal polling would allow. [RFC 5345 §3.6]
Applied to notification sending, the trap-directed polling concept requires that any value (information) sent by a notification is also retrievable by polling which is, in the end, sending GET-like SNMP requests. AgenPro supports this concept as it generates code to fire traps by providing references in place of values.
A reference in this context is the instance object identifier. The object type (class) identifier is defined by the OBJECTS clause of a NOTIFICATION-TYPE. The instance identifier is then the .0-suffix for scalars and the index OID for tabular objects.
When defining traps for a simulation agent, you first define the name of the trap. This name is different from the NOTIFICATION-TYPE object name as it identifies a reference set rather than a notification type. The second step is then defining the references (see “Simulation Properties” on page 44 for details).
The following sections describe how a simulation agent is configured, started and used at runtime.