LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lp.Gets - Perform a SNMP Get on multiple OID

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.


responsenumber = lp.Gets(ip,"oid1,oid2,…",”arrayname”);


The lp.Gets funtion realize a SNMP GET with multiple SNMP object ID on a specific IP address.


ip - The IP address as a character string ("") or a variable, example: l_host)

The IP address should exist in the directory

"oid,oid,..." - A set of snmp object id, A maximum of 15 SNMP OID can be collected by this way.

This is a character string of a set of SNMP OIDs. These OIDs should be imperatively defined in the LoriotPro MIB database (the MIB tree) and should pertain to the same snmp table object. You can't use OID in doted notation.

Return Values

responsenumber: The number of retreived objects else 0

Return nil if an error occurs

arrayname : Provide an array of all the requested SNMP OID.

If the syntax is : lp.Gets(lp_host, « sysname.0,syslocation.0 », « myarray ») ;

The array contains two values


Return nil if an error occurs


lp_value = 0;
lp_buffer = "no found";

lp_value=lp.Gets(lp_host,"sysname.0,syslocation.0", "a") ;

if lp_value ~= nil then