PowerSNMP for .NET | GetBulk Code Example

See all PowerSNMP for .NET Code Examples

GetBulk Example

This example demonstrates sending a GetBulk request and receiving the response.

 

//Create Manager, and Socket to send request from
Manager manager1 = new Manager();
SnmpSocket managerSocket = new SnmpSocket(manager1);

//Create GetBulk request
GetBulkMessage request = new GetBulkMessage();

//Request the 6 objects after 'system'
//This means creating a GetBulk message with a single variable and Repetitions set to 6.
request.Variables.Add(manager1.Mib.CreateVariable(NodeName.system));
request.Repetitions = 6;

ResponseMessage response = managerSocket.GetResponse(request, new Dart.Snmp.IPEndPoint("myAgentAddress", Agent.DefaultPort));

//Display response
Console.WriteLine(response.ToString());

 

To download a trial please visit the PowerSNMP for .NET product page.