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.
‘uid,value = lp.FoundADVAuditUID('ip',audit_ref,'param');
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.
‘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.
‘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.
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.
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.
The threshold is set to 5% of total disk space.
The script code :
lp.Print("Found UID : ",uid," ",value,"\n");
If the parameter is not well set the function return nil.