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.SetADVTCPPollingUID - Modify the properties of an TCP Audit plugin

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.SetADVTCPPollingUID('uid',option,'value');

Description

The lp.SetADVTCPPollingUIDLUA function modifies the properties of an TCP Audit plugin attached to a host in the directory.

Parameters

‘uid’      The UID of the audit plugin to modify

option  The number of the option to modify

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

This one can be added in a script with the command in the beginning of the script

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

LP_LUA_ADV_POLLING_INTERVAL = 43

LP_LUA_ADV_EVENT_REF       = 44

LP_LUA_ADV_EVENT_LEVEL     = 45

LP_LUA_ADV_CONDITION       = 46

LP_LUA_ADV_ENABLE   = 47

LP_LUA_ADV_AUDIO_GENERATE = 48

LP_LUA_ADV_REPORT_GENERATE = 49

LP_LUA_ADV_SLA      = 50

LP_LUA_ADV_TITLE    = 51

LP_LUA_ADV_PARAM    = 52

LP_LUA_ADV_AUDIT_NUMBER = 54

‘value’ The new value of 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

We will modify the option of an existing TCP AUdit plugin.

LUA set tcp audit plugin

We use the Wizard to find the UID of the plugin.

LUA set tcp audit plugin

 

LUA set tcp audit plugin

The LUA code

--[[

LP_LUA_ADV_POLLING_INTERVAL =43

LP_LUA_ADV_EVENT_REF       =44

LP_LUA_ADV_EVENT_LEVEL     =45

LP_LUA_ADV_CONDITION       =46

LP_LUA_ADV_ENABLE   =47

LP_LUA_ADV_AUDIO_GENERATE =48

LP_LUA_ADV_REPORT_GENERATE =49

LP_LUA_ADV_SLA      =50

LP_LUA_ADV_PARAM    =52

LP_LUA_ADV_TCP_PORT =53

LP_LUA_ADV_PROTOCOL =55

 

]]--

 

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

 

lp.SetADVTCPPollingUID('5165290750077829257',LP_LUA_ADV_POLLING_INTERVAL,'15');

lp.SetADVTCPPollingUID('5165290750077829257',LP_LUA_ADV_EVENT_REF,'8999');

lp.SetADVTCPPollingUID('5165290750077829257',LP_LUA_ADV_EVENT_LEVEL,'4');

lp.SetADVTCPPollingUID('5165290750077829257',LP_LUA_ADV_PARAM,'new param');

lp.SetADVTCPPollingUID('5165290750077829257',LP_LUA_ADV_CONDITION,LP_LUA_ADV_CONDITION_NOSENT);

LUA set tcp audit plugin

Warning  ! You can modify the TCP port but in that case the title of the plugin will not be changed. You can use the lp.SetDirectoryUID to perfom this operation in a second time.

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

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

The LUA code

 

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

LUA set tcp audit plugin

LUA set tcp audit plugin

 

 


www.loriotpro.com