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.GetSLAList - Retrieve a list of the SLA directories

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.GetSLAList(‘LoriotProID’,’array’);

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

Description

The lpsla.GetSLAList LUA function retrieves a list of directories of the Windows file system for the specified LoriotPro ID.

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

‘LoriotProID’     An ID that uniquely identifies a LoriotPro license (see the file bin/licence.ini)

‘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

Cet exemple affiche la liste des SLA disponibles. 

-- 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");

 i=lpsla.GetSLAList(a[l],"aa");

      if i then

            for j=0,i-1 do

            lp.Print("\t",aa[j]," SLA \n");

           end

       end

end

end

 

SLA directories

 


www.loriotpro.com