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

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’ = lp.FoundADVTCPUID('ip',tcp_port);

Description

The lp.FoundADVAuditUID LUA function retrieve the Unique IDentifier UID attached to a directory TCP Polling plugin by usingthe TCP port number. There cannot be more than one plugin with areference X and a parmter Y attached to a host in the directory (auto-configuration). When creating manually the contain of the directry it can be possible to created double entries of plugin on a host object, it than case the function will return the first object found.

Parameters

‘ip’                   The IP address of the host.

tcp_port           The TCP port number (0 à 65535) to find

Return Values

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

nil                  Return nil if an error occurs.

Example

Example of TCP polling attached to a host on port 8010; This polling check that the LoriotPro WEB server is responding to TCP connect request.

TCP polling LUA script

Script code that permet a search

 uid=lp.FoundADVTCPUID('127.0.0.1',8010);
lp.Print("Found uid : ",uid,"\n");

 Result of the code execution:

TCP polling LUA script

 

 


www.loriotpro.com