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

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.FoundADVAuditUID('ip',audit_ref,'param');

Description

The lp.FoundADVAuditUID LUA function retrieve the Unique IDentifier UID attached to a directory Audit plugin by using its reference number and its parameters.

It is possible to attached multiple TCP polling to a host, in that case the function retrun the first entry found.

Parameters

‘ip’                         The IP address of the host to which the Audit plugin is attached.

audit_ref            The audit reference number of the search audit.

‘param’                The parameter used to initialise the Audit.

Return Values

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

value             Return 1 if the plugin is found.

nil                  Return nil if an error occurs.

Example

The Audit plugin attached to a host in the directroy have a reference number. You can use the Wizar of the script editor to find and insert a reference in a script.

audit plugin lua

audit plugin lua

In the following example, we use the hard disk audit with the reference 100, the parameter here is the threshold of disk used in %. This audit is attached to hots 127.0.0.1. This is the LoriotPro itself but any host supporting the Host Ressource MIB can support this Audit.

audit plugin lua

The threshold is set to 5% of total disk space.

audit plugin lua

The script code :


uid,value=lp.FoundADVAuditUID('127.0.0.1',100,'5');
lp.Print("Found UID : ",uid," ",value,"\n");

The result:

audit plugin lua

If the parameter is not well set the function return nil.

audit plugin lua

 

 


www.loriotpro.com