Next Topic

Previous Topic

Book Contents

Sample Script: TLuaSNMP

--Simple example of SNMP interface
SNMP = TLuaSNMP();
SNMP:Open("public");

iSyntax =1

sData = SNMP:Get("iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.
ifEntry.ifInOctets.1",iSyntax);

if sData ~= "" then

	print(sData);
	SetExitStatus("Got sample value: "..sData.." bytes received",true);

else

	SetExitStatus("Get failed",false);

end