SNMP GET-NEXT request
Namespace:
SnmpSharpNetAssembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.2.0 (0.5.2.0)
Syntax
| C# |
|---|
public Dictionary<Oid, AsnType> GetNext( SnmpVersion version, string[] oidList ) |
| Visual Basic (Declaration) |
|---|
Public Function GetNext ( _ version As SnmpVersion, _ oidList As String() _ ) As Dictionary(Of Oid, AsnType) |
| Visual C++ |
|---|
public: Dictionary<Oid^, AsnType^>^ GetNext( SnmpVersion version, array<String^>^ oidList ) |
Parameters
- version
- Type: SnmpSharpNet..::.SnmpVersion
SNMP protocol version number. Acceptable values are SnmpVersion.Ver1 and SnmpVersion.Ver2
- 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
Examples
SNMP GET-NEXT request:
CopyC#
Will return:
CopyC#
String snmpAgent = "10.10.10.1"; String snmpCommunity = "private"; SimpleSnmp snmp = new SimpleSnmp(snmpAgent, snmpCommunity); Dictionary<Oid, AsnType> result = snmp.GetNext(SnmpVersion.Ver1, 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()); } }
1.3.6.1.2.1.1.1.0 = OctetString: "Dual core Intel notebook"