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

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,OID,name = lp.GetV2c_p('ip','port','community','oid')

Description

Perform a SNMP GET in version 2c on the specified IP and UDP port (port of the SNMP agent), for the specified MIB object (oid) with the specified SNMP community string.

Parameters

ip - The IP address of the Host

port - UDP port of the snmp agent

community - The SNMP community

oid - The MIB object

name - The object name

Return Values

value : the return status (0 is OK)

buffer : the returned value for that object

OID: The object id

name: The object name

Return nil if an error occurs

Example

value,buffer,oid,name = lp.GetV2c_p("10.1.0.254","161","public","sysname.0")
lp.Print(value,"/",buffer,"/",oid,"/",name,"\n")

Return: 0/router26683A/1.3.6.1.2.1.1.5./sysname.0


www.loriotpro.com