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

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.GetADVInformation('uid','Array');

Description

The lp.GetADVInformation LUA function retreive in a table all the settings of an Audit or a TCP plugin.

Parameters

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

‘array’              An emtpy array that will contain the returned parameters                       

Return Values

value : value 1 is successfull.

Return nil if an error occurs

Returned value

Description

Array.enable

Equal 1 if the plugin is running else 0

Array.ip

The IP address of the plugin attached host
‘no found’ if not aps

Array.polling_type

The polling type (Audit or TCP) 
ADV_POLLING_TCP_CONNECT =  1
ADV_POLLING_AUDIT_LUA = 10

Array.protocol

Only is the polling is TCP 1
array.protocol = 16

Array.port

Only is the polling is TCP 1
The poller port can range from 0 à 65535

Array.process_name

Reserved

Array.process_id

Reserved

Array.request

Reserved

Array.lua_file

Only is the polling is of Audit type
The LUA file used to perform the audit

Array.lua_locked

Reserved

Array.lua_file_title

Only is the polling is of Audit type
The title of the Audit script

Array.lua_param

Only is the polling is of Audit type
The parameter of the Audit

Array.lua_lasterror

Only is the polling is of Audit type
The information provides by the script on return (lp_buffer)

Array.lua_audit_ref_number

Only is the polling is of Audit type
The reference number of the AUdit script

Array.lua_audit_type_number

Réservé

Array.timesfirst

Un timestamp

Array.timeslast

Un timestamp

Array.polling_interval

The polling interval or execution interval of the Audit

Array.SLA

Equal 1 if the response time are collected else 0

Array.number_total

Reserved

Array.number_receive

Reserved

Array.number_fail

Reserved

Array.last_adv_polling_sent

Reserved

Array.last_adv_polling_rcv

Reserved

Array.last_adv_rtt

Reserved

Array.max_polling_resp

Reserved

Array.min_polling_resp

Reserved

Array.rttvrap

Reserved

Array.rttpos

Reserved

Array.generate_graph

Only is the polling is of Audit type
The graph is generated

Array.graphvrap

Reserved

Array.graphpos

Reserved

Array.max_graph_resp

Reserved

Array.min_graph_resp

Reserved

Array.graph_type

Only is the polling is of Audit type
If 0 = counter (the différence (n-1)-n is displayed.
Ifi 1 = gauge the value is display without any change

Array.graph_title

Only is the polling is of Audit type
The graphe title is generated by the function

Array.event_ref

The event numberused for sending an alert

Array.event_level

The level of the event (color in the log)

Array.status

The module status 

0 = no running (magenta)

1 = blue

2 = Running fine (green)

3 = yellow

4 = Problem occurs (red)

Array.condition

Condition to reach for event sending 

LP_LUA_ADV_CONDITION_DOWN= 1;

LP_LUA_ADV_CONDITION_BECOMEDOWN= 2;

LP_LUA_ADV_CONDITION_UP= 3;

LP_LUA_ADV_CONDITION_BECOMEUP= 4;

LP_LUA_ADV_CONDITION_NOSENT= 5; 

Array.generate_audio

Provide to the script an information for generationg audio.
0 = No, 1 = Yes

Array.generate_report

Fournit au script une information pour éventuellement générer un rapport.
0 = No, 1 = Yes

Array.running

Reserved

 

Example

The Wizard of the script editor allows you to insert at the cursor position the UID of the plugin.

adv info lua script

adv info lua script

The lua script


i=lp.GetADVInformation('5136739022969765953',"t");
for key,value in pairs(t) do lp.Print("[",key,"] [",value,"]\n")
end

 

adv info lua script

 

 


www.loriotpro.com