Next Topic

Previous Topic

Book Contents

Walk

TLuaSNMPResult Walk(string sOID)

Return values

A data structure containing the result of the walk operation. When the end is reached the m_sOID member of the TLuaSNMPResult structure will be empty.

Parameters

  • sOID - OID to walk. This OID should be the OID last returned by the previous call to Walk, or if this is the first call to Walk it should be the same OID as used in BeginWalk.

Remarks

Before the first call to the Walk function the program must call the BeginWalk function to set the start of the Walk. Walk will retrieve all the child and sibling object identifiers of the start OID set by the BeginWalk functions.

Example

--KNM Lua API example (C) 2007 Kaseya AB
--Simple example of SNMP interface
SNMP = TLuaSNMP();
SNMP:Open("public");
sOID = "iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry";

--A repeat ... until loop
Result = TLuaSNMPResult();
SNMP:BeginWalk(sOID);
repeat
	Result = SNMP:Walk(sOID);
	sOID = Result.m_sOID;
	print("OID "..sOID);
	print("Data "..Result.m_sData);
	print("Syntax "..Result.m_iSyntax);
until Result.m_sOID == "";