![]() ![]() |
LoriotPro
scripting documentation |
![]() ![]() ![]() |
![]() |
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
number = lp.GetSnmpObjectInformations('oid','array');
Description
The lp.GetSnmpObjectInformations LUA function retrieves information about a SNMP MIB object
Parameters
"oid" - A SNMP object ID, for example "sysname"
WARNING ! You can specify a complete object name with the syntax MIB-DESCRIPTION:ObjectName. This is in case a duplicate object name could exist in the MIB database
Example: RFC1213:sysname
array’ A table name for the retruned values
Variables en retour |
description |
array.mib_description |
The MIB "Description" field where this MIB object is defined. |
array.mib_file |
The file name located inbin/mibs where this MIB object is defined. |
array.oid |
The MIB object in a doted format |
array.name |
The MIB object name |
array.syntax |
The MIB object syntax |
array.father |
The father of the MIB object in the MIB tree |
array.child |
The name of the first underneath MIB objectt (if this object is a branch in the MIB tree). |
array.id |
The last index for this MIB object { father id } |
array.dupped |
If this name is duplicate in the LoriotPro MIB database. Warning ! If this value equal 1 the name is probably used twice. In that case use the extended syntax for selection the object. |
Return Values
number A value greater than 0 if the MIB object exist
nil Return nil if an error occurs
‘array’ The array of collected values
Example
Nous cherchons la description d’un objet SNMP de la MIB BRIDGE-MIB (rfc1493).
BRIDGE-MIB DEFINITIONS ::= BEGIN
….
dot1dStpTimeSinceTopologyChange OBJECT-TYPE
SYNTAX TimeTicks
ACCESS read-only
STATUS mandatory
DESCRIPTION
"The time (in hundredths of a second) since the
last time a topology change was detected by the
bridge entity."
REFERENCE
"IEEE 802.1D-1990: Section 6.8.1.1.3"
::= { dot1dStp 3 }
Exist = lp.GetSnmpObjectInformations('BRIDGE-MIB:dot1dstptimesincetopologychange' ,'array');
if (exist) then
lp.Print("mib_description : ",array.mib_description,"\n");
lp.Print("mib_file : ",array.mib_file,"\n");
lp.Print("oid : ",array.oid,"\n");
lp.Print("name : ",array.name,"\n");
lp.Print("syntax : ",array.syntax,"\n");
lp.Print("father : ",array.father,"\n");
lp.Print("child : ",array.child,"\n");
lp.Print("id : ",array.id,"\n");
lp.Print("dupped : ",array.dupped,"\n");
description = lp.GetSNMPObjectDescription('BRIDGE-MIB:dot1dstptimesincetopologychange');
lp.Print("\ndot1dstptimesincetopologychange : \n\n", description,"\n");
end
![]() |
|