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

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

‘description’ = lp.GetSNMPObjectDescription('oid');

Description

The lp.GetSNMPObjectDescription LUA function retrieves the description filed of a MIB object.

Parameters

‘oid’                A character string of the snmp object identifer.

Warning ! The object should be in teh MIB database, (MIB compiled), It is not possible to use the doted notation.

Return Values

‘description’               A charater string with the description of the MIB object if it is not empty in the MIB file.

Warning  ! In case of duplicate name in the MIB tree, you must use the extended syntax.

DESCRIPTION-MIB:nom 

 

Return nil if an error occurs

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

Trying to search for a descritpion of the 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 }

          dot1dStpDesignatedRoot OBJECT-TYPE

              SYNTAX  BridgeId

              ACCESS  read-only

              STATUS  mandatory

              DESCRIPTION

                      "The bridge identifier of the root of the spanning

                      tree as determined by the Spanning Tree Protocol

                      as executed by this node.  This value is used as

 

 

                      the Root Identifier parameter in all Configuration

                      Bridge PDUs originated by this node."

              REFERENCE

                      "IEEE 802.1D-1990: Section 4.5.3.1"

              ::= { dot1dStp 5 }

 

 The scipt :

description = lp.GetSNMPObjectDescription('dot1dstptimesincetopologychange');

lp.Print("dot1dstptimesincetopologychange : \n\n", description,"\n");

description = lp.GetSNMPObjectDescription('dot1dstpdesignatedroot');

lp.Print("dot1dstpdesignatedroot : \n\n", description,"\n");

 

 

mib object description 

Warning  ! The format of the retruned string is the same as in the MIB file.

We will use a full name to be sure that the retrieve object description is the good one. 

mib object description

 

 


www.loriotpro.com