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

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

val=lp.StatusOfGObject('GObjectName','array')

Description

Retrieve in a LUA table the current values of the Global Object

List below

Name

A unique name that identify this Global Object

Group Name

Define the group name in which this Global Object belongs.

List box Group Scheduler function

Allows the selection of the function run by the Audit for that group.

Edit Group Scheduler function

Open the LUA editor and the Group Scheduler function

Param 1

The first argument provided to the attached LUA function

Param 2

The second argument provided to the attached LUA function

   

Scheduled

Run the associated LUA function at every audit interval. Yes or No.

If Yes the LUA function will be executed each time that an Audit managing this group of Global Object look at it and if the interval is timeout and if the Global Object is not locked by another Audit.

 

Scheduling Parameters

Locked

The access to this Global Object has conflicts.

Function Name

The name of the Global Object LUA function called by the Audit that update this Global Object

IP reference

An IP Reference provide as an argument to the LUA function

check box Not Locally Backup

If checked the Global Object will not be monitored by this LoriotPro if the LoriotPro master of this Global Object failed (heartbeat lost).

Interval

The minimum interval of time between two execution of the Global Object LUA function

Interval Type

Allow to defined if the Interval value is in seconds or milliseconds

 

Pre-Scheduling Options

Check Type

Activate the check of the availability of a reference for a specified IP or UID before running the Global Object LUA function.

Check if IP status

Specify the IP of the host (must be defined in the LoriotPro Directory

Check if UID status

Specify the UID of the host (must be defined in the LoriotPro Directory

 

Current Global Object values

 

String

A string value for this object (example :  “this is a string”)

Double

A type double value for this object (example: 245.4501 )

Status

An integer value defining the current status (example: 2)

 

Autoload this object at startup with default values

The Current Global Object values will be initialized with the default values

   
   

Parameters

GObjectName - the name of the Global Object

timestamp - A OS timestamp

Return Values

value : val=1 if succeeded

Return nil if an error occurs

Example

val=lp.StatusOfGObject('SERVER_1','array')
if val ~= nil then
for k,v in pairs(array) do
lp.Trace(k,"=",v,"\n")
end
end

Example of return:

schedule=1
string=This is a string
FunctionName=Server1_fn
param1=ArgumentX
ipref=0
time=1384528198
lock=0
clock=25265717
nobackup=0
fileok=1
FunctionExecutionTime=0
param2=
status=1
checkstatus=0
refstatus=1
GroupName=SERVERS
intervaltype=0
double=500.45
istimetorun=0
name=SERVER_1
accessed=260
type=1
uidref=5946135385246531590
ip_master=192.168.1.1
interval=10


www.loriotpro.com