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.GetRouterIfList

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 = lp.GetRouterIfList('router_id','array');

number = lp.GetRouterIfList('router_id','array',index); 

Description

The lp.GetRouterIfList LUA function retrieve in an array the list of IP adresses attached to a router object.

Warning ! The router must exist in the directory

Parameters

‘router_id’            The router identifier (one of it IP address)

‘array’                  The array name for the returned values

index                   Equal to 1 if the table start at index 1, require to support the ipairs(array) and be conform to the LUA table.

Return Values

number                 The quantity of entries in the array

‘array’                  The array name for the returned values

Return nil if an error occurs

Example

router_id=lp.GetFirstRouter();

 

if router_id~=nil then

a=1;

while (a==1) do

if router_id==nil then break end

lp.Trace("Router ID : ",router_id,"\n");

      if lp.GetRouterInformation(router_id,"t")~=nil then

      lp.Print("UID : ",t.UID,"\n");

      lp.Print("name : ",t.name,"\n");

      lp.Print("x : ",t.x,"\n");

      lp.Print("y : ",t.y,"\n");

      lp.Print("status : ",t.status,"\n");

      lp.Print("type : ",t.type,"\n");

      lp.Print("flagused : ",t.flagused,"\n");

      end

u=lp.GetRouterIfList(router_id,"inf",1);

if u then

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

end

router_id=lp.GetNextRouter(router_id);

 

end

end

router interface list in LUA

 


www.loriotpro.com