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.FindSNMPObject - Check if a snmp object is available in the MIB tree

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

Result = lp.FindSNMPObject(“named_oid”);

Description

Browse the LoriotPro MIB database and look for the specified MIB object name (OID)

Parameters

"named_oid" - The MIB object name

Return Values

1 if the object is found in the database or nil in other case

Remark

OID in doted syntax (" 1.3.4.3.2") are not supported

Example


lp_value = 0;
lp_buffer ="error";
if lp.FindSNMPObject("sysname")~=nil then
lp.Trace("sysname exist");
else
lp.Trace("sysname not loaded");
end

obj="sysname";
if lp.FindSNMPObject(obj)~=nil then
       lp.Trace(obj," exist\n");
else
       lp.Trace(obj," noloaded\n");
end

find mib object

Warning ! The object name should no contains the dot sign

find mib object

It is possible to use the extended notation MIB-DESCRIPTION:nom to find an object that is duplicate in the MIB tree.

find mib object

 


www.loriotpro.com