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

lpsla.GetLoriotProIDList - Retrieve a list of LoriotPro ID

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

number = lpsla.GetLoriotProIDList(‘array’);

number = lpsla.GetLoriotProIDList(‘array’,index);

Description

The lpsla.GetLoriotProIDList LUA function retrieves a list of directories of the Windows file system. The directory name is the LoriotPro ID of the LoriotPro host that peforms the SLA data collection.

Each LoriotPro has a unique ID defined in the license key.

See the LoriotPro documentation below for more explanation about the directroy structure of SLA files.

Description technique de la solution de contrôle de QOS Loriotpro

Parameters

‘array’   An array of directory name

index     Equal to 1 if the table start at 1, required to support the LUA ipairs(array) function.

Return Values

Number         The number of entries in the table 'array’

Warning ! . LoriotPro LUA function returns indexed table starting at index 0. Usually LUA function returns table starting at index 1. This cas cause errors when using some management function of LUA.

array[0]…array[number-1]             An array of the IP adresses of the devices found. (or array[1]…array[number] if index)

nil                            nil if an error occurs

Example

The following example display the lis of the directories. Only one LoriotPro is on the network.

-- sample

if (lp.IsDebugMode()==1) then

lib,init=lp.LoadLibrary(lp.GetPath().."/lua_lp_slad.dll","libinit");

else

lib,init=lp.LoadLibrary(lp.GetPath().."/lua_lp_sla.dll","libinit");

end 

if (lib) then 

init(); 

k=lpsla.GetLoriotProIDList("a"); 

for l=0,(k-1) do

 lp.Print(a[l]," LoriotPro ID \n");

 end

for l=0,table.getn(a) do

 lp.Print(a[l]," LoriotPro ID \n");

 end

k=lpsla.GetLoriotProIDList("a",1);

for key,value in ipairs(a) do lp.Print("[",key,"] [",value,"]\n") end

end

SLA directories ID

 


www.loriotpro.com