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.UpdateADVAuditPolling - Update the settings of an 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’,status = lp.UpdateADVAuditPolling('ip', audit_ref, 'param', poll_interval, enable, gen_audio, gen_report, event, level, condition, sla);

Description

The lp.UpdateADVAuditPolling LUA function update the settings of an Audit plugin attached to a host in the directory. If an audit with the same main identification properties already exists then only the new secondary properties are updated.

Parameters

Main parameters

‘ip’                      The IP address of the host

audit_ref            The reference number of the audit to attach

‘param’               The parameter used to initailize the 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.

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

The following example insert a new audit plugin to the host ‘127.0.0.1’ and performs an update of the polling interval parameter.

Remember that the wizard can helps you to select the Audit in the Directory.

adv audit polling update with lua

adv audit polling update with lua

The LUA code :

lp.Print("Start\n");

uid1,ret=lp.InsertADVAuditPolling("127.0.0.1",1,"param1",60,0,1,1,45000,5,1,1,"sample audit module 1");

 if (uid1)then

lp.Print("Insertion = ",ret," UID ",uid1,"\n");

uid1,ret=lp.UpdateADVAuditPolling("127.0.0.1",1,"param1",80,1,1,1,45000,5,1,1); 

end 

The result

adv audit polling update with lua

 

adv audit polling update with lua

The audit properties has been changed, the polling interval is now of 80 seconds and the audit is running.

adv audit polling update with lua

 

 


www.loriotpro.com