SNMP GET-BULK request

Namespace: SnmpSharpNet
Assembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.9.1.0 (0.9.1)

Syntax

C#
public Dictionary<Oid, AsnType> GetBulk(
	string[] oidList
)
Visual Basic
Public Function GetBulk ( _
	oidList As String() _
) As Dictionary(Of Oid, AsnType)
Visual C++
public:
Dictionary<Oid^, AsnType^>^ GetBulk(
	array<String^>^ oidList
)

Parameters

oidList
Type: array<System..::..String>[]()[][]
List of request OIDs in string dotted decimal format.

Return Value

Result of the SNMP request in a dictionary format with Oid => AsnType values

Remarks

Performs a GetBulk SNMP v2 operation on a list of OIDs. This is a convenience function that calls GetBulk(Pdu) method.

Examples

SNMP GET-BULK request:
CopyC#
String snmpAgent = "10.10.10.1";
String snmpCommunity = "private";
SimpleSnmp snmp = new SimpleSnmp(snmpAgent, snmpCommunity);
Dictionary<Oid, AsnType> result = snmp.GetBulk(new string[] { "1.3.6.1.2.1.1" });
if( result == null ) {
  Console.WriteLine("Request failed.");
} else {
  foreach (KeyValuePair<Oid, AsnType> entry in result)
  {
    Console.WriteLine("{0} = {1}: {2}", entry.Key.ToString(), SnmpConstants.GetTypeName(entry.Value.Type),
      entry.Value.ToString());
  }
}

See Also