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.SetDirectoryUID - Change of directory object parameters

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’,value = lp.SetDirectoryUID('uid',option,'value');

Description

The lp.SetDirectoryUID LUA function allows the change of directory object parameters.

Warning ! The name of object is sometimes not changeable because it is dynamically control by LoriotPro.

Parameters

‘uid’           The UID of the Directory object

option  The option number to modify (see table below)

The list of available option is defined in the file bin/config/script/ loriotinit.lua.

This one can be added to the beginning of the script with the command :

dofile(lp.GetPath().."/config/script/loriotinit.lua");

The file

LP_LUA_DIRECTORY_NAME =58

LP_LUA_DIRECTORY_PLUGIN_NAME =59

LP_LUA_DIRECTORY_STRING =60

Warning ! The items of the directory that are plugins uses LP_LUA_DIRECTORY_PLUGIN_NAME as name in the directory. ’Audit plugin items, TCP polling items, MRTG graph item, hosts and containeruse the property LP_LUA_DIRECTORY_NAME. Warning ! The name of object is sometime not changeable because it is dynamically control by LoriotPro.

‘value’ The new value to assigne to the option.

Return Values

‘uid’                 The UID number of the audit as unsigned 64bits coded as a character string.

value              The result of the operation, = 0 if it is a new insert or =1 if the audit already existed and has been updated.

nil                    If an error occurs

Example

lua logoLoriotPro WEB site Documentation scripting LoriotPro
Extensions du language LUA

Table des matières    Liste de fonctions

Imprimer la page en cours Mail this  link UTUBE Channel

We use the Wizard to find the UID of the TCP plugin that we want to change

 dofile(lp.GetPath().."/config/script/loriotinit.lua");

lp.SetADVTCPPollingUID('5165290750077829257',LP_LUA_ADV_TCP_PORT,8010);

lp.SetDirectoryUID('5165290750077829257',LP_LUA_DIRECTORY_NAME ,"HTTP Polling TCP 8010");

lp.UpdateDirectory();

lp.LocateDirectoryUID('5165290750077829257');

set directory

 

 

 


www.loriotpro.com