Dart SNMP Library 4.0
Request Event
Decoded request message.
Description
Raised when an SNMP request is received.
Syntax
Visual Basic
Public Event Request( _
   ByVal requestMessage As SnmpMessage _
)
Parameters
requestMessage
Decoded request message.
Remarks

The developer must handle this event in their code (such as in the example below) for the Agent to respond to requests.

When SNMPv3 is used, the initial requests may not include an EngineId or time synchronization information. In this case a report PDU is automatically generated by CreateResponse and must be sent to enable subsequent authentication.

If CreateResponse does not produce the desired response, the response SnmpMessage may be manually generated.

Example
Demonstrates how to start an Agent listening for incoming requests on the specified local binding address, and how to respond to requests.
Private Sub StartAgent(localAddress As String)
    'Populate a variable on the agent
    Agent1.Variables.Add Agent1.Mib.Nodes("sysDescr").CreateVariable("System Description")
    'Establish local binding address
    Dim localEP As New IPEndPoint
    localEP.NameOrAddress = localAddress
    localEP.Port = 161
    'Start agent on the specified local binding address
    Agent1.Start localEP, True
End Sub

Private Sub Agent1_Request(ByVal requestMessage As DartSnmpCtl.ISnmpMessage)
    Agent1.SendResponse Agent1.CreateResponse(requestMessage), requestMessage.Origin
End Sub
See Also

Agent Object  | Agent Members


PowerSNMP for ActiveX Documentation Version 4.0
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic