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

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.GetTrapFilterInformation(‘uid’,’Array’)

Description

The lp.GetTrapFilterInformation LUA function retrieves a table with the information attached to a a Trap filter.

Parameters

uid - A 64 bits value in a character string format that identify theTRAP filter object in the filter tree

"array" - A name assigned to the array that will collect the returned values

Return Values

value : a positif value if data are present.

Return nil if an error occurs

Valeur

Description

Array.trap

 

The trap name

Array.name

 

 The name of the table

Array.specific

 

The specifique number if it is V1 trap

Array.eventnumber

 

The event number sent by defaut on trap reception

Array.string

 

The string use to create the event

Array.ctrl

 

A control value

 

0xFADA

Array.counter

 

The total number of trap received by LoriotPro since the last start

Array.uid

 

The uid of the ‘trap filter’

Array.last

 

A timestamp of the last received trap of this type.

Array.first

 

The timestamp of the first trap received of this type

Array.first_since

 

The timestamp of the first trap received since the last global trap aknowledgment

Array.number_total

 

The total number of received traps

Array.number_ack

 

The total number of acknowledged traps

Array.number_delete

 

The total number of trap cleared

Array.number_auto_delete

 

The total number of trap cleared due to an overhead of the trap viewer

Array.number_since_clear

 

The total number received since the last global acknowledgment

Array.number_not_displayed

Trap not displayed in the trap viewer (listbox)

Array.number_displayed

 

Trap displayed in the trap viewer

Array.max_display

 

The maximum number of trap that can be displayed in the trap viewer ‘TRAP’ (-1 equal no limits)

Array.number_between_action

 

reserved

Array.disable

 

State of the filters 

1 - Filter not enable ( action are also disable)

0 – filter enable

 

Example

lua logoLoriotPro WEB site Documentation scripting LoriotPro
Extensions du language LUA

Table des matières    Liste de fonctions

Imprimer la page en cours Mail this  link UTUBE Channel

With the trap filter counters option you can see the informations attached to each TRAP filter.

get trap filter information with lua

get trap filter information with lua

Warning  ! The UID column is hidden. Use the mouse to expand the column on the left of the ‘Total filtered’.

get trap filter information with lua

get trap filter information with lua

Use the wizard to insert a a Trap Filter UID

get trap filter information with lua

get trap filter information with lua

Example of code :

value=lp.GetTrapFilterInformation("4740859784079605760","Array");

 

if value then

lp.Print("Array.trap :",Array.trap,"\n");

lp.Print("Array.name :",Array.name,"\n");

lp.Print("Array.specific :",Array.specific,"\n");

lp.Print("Array.eventnumber :",Array.eventnumber,"\n");

lp.Print("Array.string :",Array.string,"\n");

lp.Print("Array.ctrl :",Array.ctrl,"\n");

lp.Print("Array.counter :",Array.counter,"\n");

lp.Print("Array.uid :",Array.uid,"\n");

lp.Print("Array.last :",Array.last,"\n");

lp.Print("Array.first :",Array.first,"\n");

lp.Print("Array.first_since :",Array.first_since,"\n");

lp.Print("Array.number_total :",Array.number_total,"\n");

lp.Print("Array.number_ack :",Array.number_ack,"\n");

lp.Print("Array.number_delete :",Array.number_delete,"\n");

lp.Print("Array.number_auto_delete :",Array.number_auto_delete,"\n");

lp.Print("Array.number_since_clear :",Array.number_since_clear,"\n");

lp.Print("Array.number_not_displayed :",Array.number_not_displayed,"\n");

lp.Print("Array.number_displayed :",Array.number_displayed,"\n");

lp.Print("Array.max_display :",Array.max_display,"\n");

lp.Print("Array.number_between_action :",Array.number_between_action,"\n");

lp.Print("Array.disable :",Array.disable,"\n");

end

get trap filter information with lua

 

 

 


www.loriotpro.com