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

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

'uid','dt' = lp.GetFirstDirectoryUID('uid','array');

Description

The lp.GetFirstDirectoryUID LUA function retrieve the UID Unique IDentifier of the first item of the LoriotPro Directory. This function is commonly used to browse the directory.

Parameters

none

Return Values

‘uid’     A UID, a unique number representing an unsigned 64 bits but stored as a character string.

'array' A LUA table with some properties of the Directory object below

UID The UID ( unique identifier) of the object
name The name of the directory object
object_type

A number that defines the type of object:

COUNTRY=1;
ORGANIZATION =2;
ORGANIZATION_UNIT=3;
NETWORK=4;
FACTORY=5;
HOST=6;
HOST_FUNCTION=7;
HOST_ALIAS=8;
HOST_EXECLINK=9;
HOST_MRTG=10;
HOST_PLUGIN=11;
HOST_ADVPOLLING=12;

string The object parameter in a character string format
ip The object ip address when applicable
plugin_name The object name when it is a plugin
UID_father The UID ( unique identifier) of the father object
UID_same  
UID_child The UID ( unique identifier) of the next child object
child The number of child objects for this father object
status The current status of the Object:
UID_alias The UID ( unique identifier) of the next alias object
alias The number of alias objects for this father object
lock_http  
access_level  

 

'dt' a pointer

Return nil if an error occurs

Example

Browse of the Directory beginning with the first object of the directory tree. Consult the lp.GetChildUID(‘uid’,’array’).

uid=lp.GetFirstDirectoryUID();

if uid then

      while (uid ~= nil) do

lp.Print(uid);

      a=lp.GetUIDInformation(uid,"b");

            if (a) then

            lp.Print(" ",b.name," ",b.plugin_name,"\n");

            end

uid=lp.GetNextDirectoryUID(uid);

      end

end

get directory udi lua

 

 


www.loriotpro.com