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.Get - Perform a SNMP Get

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,buffer = lp.Get(ip,"oid");

Description

Perform a SNMP GET of a single object "oid" on the specified IP addresse

Parameters

ip - This is a character string of the IP address x.x.x.x. This address should be imperatively defined in the LoriotPro directory

"oid" - This is a character string of the SNMP oid to query. This OID should be imperatively defined in the LoriotPro MIB database (the MIB tree)

Return Values

value : A integer value if the snmp object is an integer a gauge a counter. It return 0 if the snmp object is an octet string.

Return nil if an error occurs

buffer : Return the result of the snmp get as a character string

Return nil if an error occurs

Example

In this example the script uses the variable lp_host given as an argument by LoriotPro to the script. The sysname OID is requested to lp_host

The result (LUTEUS02) is displayed in the Value out column. As it is a snmp octet string the lp_value column contains 0.

In the following example the host IP address doesn't exist in the LoriotPro directory and the script returns lp_value at nil


www.loriotpro.com