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

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

value = lp.ClearIPTrapCounter(‘ip’);

Description

The lp.ClearIPTrapCounter LUA function performs a reset of the counter of SNMP TRAPs received by a host.

Parameters

‘ip’            The IP address of the host event counter that should be reset, a character string like : ‘ xxx.xxx.xxx.xxx‘.

Return Values

value                    1 if the operation is successfull.

nil                          an error occurs (address not find in the directory).

Example

The following example perfoms a GetIPInformation to collect the number of Traps received by a host, displays the value and then clears the counter with the ClearIPTrapCounter function.

if lp.GetIPInformation('127.0.0.1','array') then
       lp.Print(array.trapreceived,"\n");
lp.ClearIPTrapCounter('127.0.0.1');
lp.GetIPInformation('127.0.0.1','array')
       lp.Print(array.trapreceived,"\n");
end

trap counter reset lua

 


www.loriotpro.com