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.UpdateADVTCPPollingUID - Update the parameters of a 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

value = lp.UpdateADVTCPPollingUID('uid', poll_interval, enable, gen_audio, gen_report, event, level, condition, sla);

Description

The lp.UpdateADVTCPPolling LUA function updates the parameters of a TCP Audit plugin attached to a host in the directory. If a TCP audit with the same main identification properties already exists then only the new secondary properties are updated.

Parameters

Main parameters

‘uid’                  The uid of the plugin

tcp_port          The TCPport number to audit

Secondary parameters

Poll_interval     The polling interval of the audit

enable if = 1The audit will be executed at regular interval (polling interval)

            if = 0 disable the polling

gen_audio       if = 1 notify that the audit can generate audio (Text To Speech)

if = 0 notify the audit that it should not generate audio (Text To Speech)

Warning : If the script doesn't support the otpion the setting has no effect.

gen_report       If = 1 notify that the audit can generate reports

if = 0 notify the audit that it should not generate reports

Warning : If the script doesn't support the otpion the setting has no effect.

event      The event number used by the script to generate alerts (0 = no alert)

level        The level of the event sent

condition       The condition used to generate the event.

                                   1 down

                                   2 become down

3 up

4 become up

5 no sent

Warning :      The condition 5 is used to initialise the event and its level. There will be no event sent in that case. The audit can fetch the parameter and assume the sending of the event. It will ne be sent twice in that case.

sla                 If = 1 The collected data are stored in files for further SLA calculation. The data can be used by the SLA rReport Center or by the LUA functions linked to SLA manipulation.

If = 0 There is no data collection

['title']            An optional parameter that set the title of the audit in the directory

Warning :      Warning: This parameter cannot be updated.

‘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

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

lp.Print("Start\n");

tcp_port=23;

 

uid1,ret=lp.InsertADVTCPPolling(lp_host,tcp_port,60,1,1,1,45000,5,1,1);

if uid1 then lp.Print(uid1," insert TCP port 23\n"); end

 

if uid1~= nil and ret==1 then

      lp.EnableDirectoryObject(uid1);

      lp.LocateDirectoryUID(uid1);

uid=lp.FoundADVTCPUID(lp_host,tcp_port);

if (uid) then

uidret=lp.UpdateADVTCPPollingUID(uid,80,1,1,1,45000,5,1,1);

if uidret then lp.LocateDirectoryUID(uidret); end

lp.Print(uid,"  ",uid2,"\n");

end

lp.UpdateDirectory();

end

lp.Print("End\n");

 

 


www.loriotpro.com