See Also

Agent Class  | Agent Members

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages PowerSNMP for .NET

GetBulkMessageReceived Event

Dart.PowerSNMP Namespace > Agent Class : GetBulkMessageReceived Event

Occurs when an SNMP getbulk request is received.

[Visual Basic]
<DescriptionAttribute("Raised when a GetBulkMessage is received from an SNMP manager.")> <CategoryAttribute("Request")> Public Event GetBulkMessageReceived() As MessageEventHandler
[C#]
[DescriptionAttribute("Raised when a GetBulkMessage is received from an SNMP manager.")] [CategoryAttribute("Request")] public event MessageEventHandler GetBulkMessageReceived();
[C++]
[DescriptionAttribute("Raised when a GetBulkMessage is received from an SNMP manager.")] [CategoryAttribute("Request")] public: __event MessageEventHandler* GetBulkMessageReceived();
[C++/CLI]
[DescriptionAttribute("Raised when a GetBulkMessage is received from an SNMP manager.")] [CategoryAttribute("Request")] public: event MessageEventHandler^ GetBulkMessageReceived();

Event Data

The event handler receives an argument of type MessageEventArgs containing data related to this event. The following MessageEventArgs properties provide information specific to this event.

PropertyDescription
Request Gets the RequestMessage received or previously sent.
Response Gets or sets the ResponseMessage received or to be sent.

Remarks

A GetBulkMessage has been received. This message provides a mechanism for passing rows of table data to a manager.

If Agent.Variables is null, then MessageEventArgs.Response.Variables is not populated. In this case the application should either add variables to complete the response for the library to send or set MessageEventArgs.Response to null to indicate no response should be sent.

If Agent.Variables is not null, then the library will construct a default ResponseMessage. An error ResponseMessage is constructed if requested IIDs are not present.

Most agent applications will take advantage of Agent.Variables by populating it with Variable objects so that default response messages are generated.

The ResponseMessage(RequestMessage, SortedVariables) constructor is used to generate MessageEventArgs.Response.

If no ResponseMessage is sent then some SNMP managers will repeat the request.

Example

The following example demonstrates handling a GetBulk message.

[Visual Basic] 


Private Sub Agent1_GetBulkMessageReceived(ByVal sender As Object, ByVal e As Dart.PowerSNMP.MessageEventArgs) Handles Agent1.GetBulkMessageReceived
    'add GetBulkMessage variables to a listbox
    Dim msg As GetBulkMessage = e.Request
    Dim v As Variable
    For Each v In msg.Variables
        ListBox1.Items.Add(v.Id + ": " + v.Value.ToString())
    Next
End Sub

[C#] 


private void agent1_GetBulkMessageReceived(Dart.PowerSNMP.MessageEventArgs e)
{
   
// add GetBulkMessage variables to a listbox
   
GetBulkMessage msg = e.Request as GetBulkMessage;
   
foreach (Variable v in msg.Variables)
       listBox1.Items.Add(v.Id +
": " + v.Value.ToString());
}

                

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista

See Also

Agent Class  | Agent Members


Send comments on this topic.

Documentation version 1.2.0.0.

© 2008 Dart Communications.  All rights reserved.