IPWorks SNMP 2020 .NET Edition

Questions / Feedback?

Response Event

Fired when a GetResponse packet is received.

Syntax

public event OnResponseHandler OnResponse;

public delegate void OnResponseHandler(object sender, SnmpmgrResponseEventArgs e);

public class SnmpmgrResponseEventArgs : EventArgs {
  public int RequestId { get; }
  public int SNMPVersion { get; }
  public string Community { get; }
  public string User { get; }
  public int SecurityLevel { get; }
  public string SourceAddress { get; }
  public int SourcePort { get; }
  public int ErrorIndex { get; }
  public int ErrorStatus { get; }
  public string ErrorDescription { get; }
}
Public Event OnResponse As OnResponseHandler

Public Delegate Sub OnResponseHandler(sender As Object, e As SnmpmgrResponseEventArgs)

Public Class SnmpmgrResponseEventArgs Inherits EventArgs
  Public ReadOnly Property RequestId As Integer
  Public ReadOnly Property SNMPVersion As Integer
  Public ReadOnly Property Community As String
  Public ReadOnly Property User As String
  Public ReadOnly Property SecurityLevel As Integer
  Public ReadOnly Property SourceAddress As String
  Public ReadOnly Property SourcePort As Integer
  Public ReadOnly Property ErrorIndex As Integer
  Public ReadOnly Property ErrorStatus As Integer
  Public ReadOnly Property ErrorDescription As String
End Class

Remarks

The ErrorStatus and ErrorIndex parameters contain information about possible errors. ErrorDescription is a textual description of ErrorStatus. This value is parsed directly from the SNMP response, which will be a one-based value, so a value of i here maps to index i-1 in the Objects collection.

The following is a list of valid SNMP status code values:

0 (noError) No error.
1 (tooBig) The response cannot fit in a single SNMP message.
2 (noSuchName) Variable does not exist.
3 (badValue) Invalid value or syntax.
4 (readOnly) Variable is read-only.
5 (genError) Other error (SNMPv1).
6 (noAccess) Access denied.
7 (wrongType) Wrong object type.
8 (wrongLength) Wrong length.
9 (wrongEncoding) Wrong encoding.
10 (wrongValue) Wrong value.
11 (noCreation) No creation.
12 (inconsistentValue) Inconsistent value.
13 (resourceUnavailable) Resource unavailable.
14 (commitFailed) Commit failed.
15 (undoFailed) Undo failed.
16 (authorizationError) Authorization error.
17 (notWritable) Variable is not writable.
18 (inconsistentName) Inconsistent name.

The ErrorIndex parameter indicates the index of the first variable (object) that caused an error. The default value is 0.

Variable indexes start with 0. ErrorIndex has no meaning when ErrorStatus is 0 (no error).

The list of variables in the SNMP packet, including optional values and types, is provided through the Objects collection. Each object is of type SNMPObject. This type describes the Oid, ObjectType, and Value of each SNMP object. These variables must be copied to another location before the event has completed executing, or they may be overridden by other events.

The SourceAddress and SourcePort parameters show the address and port of the sender as reported by the TCP/IP stack.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks SNMP 2020 .NET Edition - Version 20.0 [Build 8202]