GetNext

GetNext is used to retrieve the next corresponding string to the specified OID.

Syntax

GetNext (oid)

Returns

String.

Example

Very simple SNMPSimple Network Management Protocol is a protocol for network management. It is used to collect information from network devices, such as servers, printers, hubs, switches, and routers. client that retrieves all the strings pertaining to the system object from a computer which has an SNMP server installed. Raw information, for example, uptime OID 1.3.5.1.2.1.1.3.0, is displayed as hundreds of a second:

Function Main

Dim snmp1 As Object

'Carriage return and line feed

cr = Chr(13) + Chr(10)

Set snmp1 = SNMP.Connect("127.0.0.1", "public")

'OID of the sysName

Val1 = "1.3.6.1.2.1.1.1.0"

'OID of the systems Object

root = "1.3.6.1.2.1.1."

'snmp1.Get Val1

While Val1 <> ""'

echo "Oid: '"+Val1 + "'"+cr

echo "Value: '"+snmp1.Get(Val1)+"'"+cr

Val1 = snmp1.GetNext(Val1)

If InStr(Val1, root) <> 1 Then Val1 =""

Wend

snmp1.Close

End Function