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.

Syntax

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

Description

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

Parameters

ip - The IP address as a character string ("xxx.xxx.xxx.xxx") 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

myarray["sysname.0"]
myarray["syslocation.0"]

Return nil if an error occurs

Exemple

lp_value = 0;
lp_buffer = "no found";

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

if lp_value ~= nil then
lp.Trace(a["sysname.0"]);
lp_buffer=a["sysname.0"];
lp.Trace(a["syslocation.0"]);
end



www.loriotpro.com