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

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

'buffer',value = lp.ascii_SetSnmpui64('ip','oid');

Description

The LUA function lp.ascii_SetSnmpui64 perfoms a SNMP SET on a single objet ID on the selected IP address.

This function is designed for handling only SNMP V2 unsigned 64 bits object. This LUA language doesn't support by default this type of value this is why Loriotpro provides a set of function that manipulates this type of value by the mean of character string.

Warning ! The IP address should be present in the LoriotPro Directory and the SNMP object should be accessible in Read/Write. The Community should as well be set correctly on both sides, in the Host configuration in Loriotpro and in the SNMP agent on the device.

Parameters

ip - The adresse IP as a character string

"oid" - The oid of the snmp object to modify followed by its index, the variable type (two letters from the following list) and the value to set

Oidname.index/(type)value

syntax

Value type

(nu)

NUL

(id)

Objet ID

(hs)

Hexa string

(os)

Octet string

(in)

Integer

(ip)

IP adresse

(co)

Counter

(ga)

Gauge

(ti)

Timeticks

 

Return Values

value : The numerical value if the SNMP object is an integer a gauge or a counter else it is a 0 for any SNMP octet string value

buffer : The returned value as a character string

Return nil if an error occurs

Example

This command set the syslocation object to the value "PARIS"

buffer',value = lp.ascii_SetSnmpui64(10.1.1.70','syslocation.0/(os)PARIS');

 


www.loriotpro.com