Responding to SNMPv3 Discovery Requests

When using the SNMPAgent/SNMPTCPAgent you will either need to use the AddUser method or use the events to respond to the Discovery request sent by SNMPMgr/SNMPTCPMgr. This article will show you how to use the events to respond to a discovery request.

Date Entered: 01/31/2012    Last Updated: 03/31/2017

You can use two different methods to respond to a Discover request sent by the SNMPMgr/SNMPTCPMgr or other manager application. You can either use the AddUser method (please see the documentation for more details) or use the events. Some of the events you will want to make use of are the GetUserPassword, GetUserSecurityLevel, and DiscoveryRequest events. Here is a detailed explanation of the sequence of events that should take place on the SNMPAgent/SNMPTCPAgent side:

1) DiscoveryRequest Event Fires

This event fires and gives you the opportunity to respond or not. If you choose to respond, you will want to set Respond to true in order to respond and complete the first step of the discovery process.

2) GetUserSecurityLevel Event Fires

This fires for the second step of the discovery process.

The User parameter should be populated with the username. You use this username to determine what the correct security level is. The component is asking you what level of security to give to this user.

Set the SecurityLevel to 1 (Auth - authentication) or 2 (AuthPriv - authentication and encryption) based on the username and what you are expecting knowing how the manager is set up.

3) GetUserPassword Event Fires

This now fires to ask for the Password associated with the user. The User parameter tells you the user it's asking about. The PasswordType parameter tells you if this is for the Authentication (1) or Privacy (2) password. The first time it fires it will be for Authentication.

4) GetUserPassword Event Fires Again

This fires again, except now the PasswordType parameter should now be for Privacy (2), and is asking for the encryption password. At this time you also specify the Algorithm to tell the component what type of encryption is used here. The following encryption algorithms are supported:

  • 1 - DES (default)
  • 2 - AES
  • 3 - 3DES
  • 4 - AES192
  • 5 - AES256

5) DiscoveryRequest Event Fires Again

This now fires for the second step of the discovery process. Again, set Respond to true in order to respond and complete the discovery process.


That completes what needs to happen on the agent side to respond to a discovery request. Upon successful completion, the manager should then be able to send Get/Set requests to the SNMPAgent/SNMPTCPAgent.


We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.