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

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.Set(ip,oid);

Description

Perform a SNMP SET on a single SNMP object specified by its name.

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 and the RW community of the host should be set correctly.

oid - This is a character string of the SNMP oid to queryand a code for the data type. This OID should be imperatively defined in the LoriotPro MIB database (the MIB tree)

Oidname.index/(type)value

syntax Value type
(nu) NUL
(id) Object ID
(hs) Hexa string
(os) Octet string
(in) Integer
(ip) IP adresse
(co) Counter
(ga) Gauge
(ti) Timeticks

Return Values

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

Return nil if an error occurs

buffer : Return the result of the SNMP SET as a character string

Return nil if an error occurs

Example

lp_value,lp_buffer=lp.Set(lp_host,"syslocation/(os)Here and nothing else");
lp.Trace(lp.Get(lp_host,"syslocation"));
lp_value,lp_buffer=lp.Set(lp_host,"syslocation/(os)Here with us");
lp.Trace(lp.Get(lp_host,"syslocation"));

snmp set example 1

lp_value,lp_buffer=lp.Set(lp_host,"syslocation/(os)Here and nothing else");
lp.Trace(lp.Get(lp_host,"syslocation"));
lp_value,lp_buffer=lp.Set(lp_host,"syslocation/(hs)31:32:33:34:36");
lp.Trace(lp.Get(lp_host,"syslocation"));

snmp set script

 

 


www.loriotpro.com