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.SetIPOption - Set host properties

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.SetIPOption(ip,param_type,"value");

Description

The lp.SetIPOption LUA function allows the change of the parameters of a host object defined in the LoriotPro directory.

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

param_type - The identifier of the parameter. The parameter list is define in the file bin/config/script/ loriotinit.lua. which can be add to the beginning of the script with the line code: dofile(lp.GetPath().."/config/script/loriotinit.lua");

Paramètre

 

Valeur possible

LP_LUA_NAME=1

String

The device name in the LoriotPro directory

LP_LUA_COMMUNITYRO=2

String

The SNMP ReadOnly community

LP_LUA_COMMUNITYRW=3

String

The SNMP ReadWrite community

LP_LUA_SNMPVERSION String The SNMP Version, can be 1 for SNMP V1 and 2 for SNMP V2c 3 for SNMP V3

LP_LUA_USER1=4

String

The user 1 variable

LP_LUA_USER2=5

String

The user 2 variable

LP_LUA_USER3=6

String

The user 3 variable

LP_LUA_SYSID=7

String

The SysObjectID SNMP object (allow you to identify the model of device, a proprietary OID)

LP_LUA_SYSNAME=8

String

The SNMP name (SNMP object sysname)

LP_LUA_GROUPREF=9

‘ip’

The IP address of the router (when the host IP address is an interface of a router)

LP_LUA_POLLING_SNMP=10

 

‘0’ disable, ‘1’ enable

LP_LUA_POLLING_PING=11

 

‘0’ disable, ‘1’ enable

LP_LUA_ISDEVICE

 

The type of host identified by their SNMP objectype object

LP_LUA_ISDEVICE_AUTO = 0;

LP_LUA_ISDEVICE_HOST = 1;

LP_LUA_ISDEVICE_SERVER = 2;

LP_LUA_ISDEVICE_HUB = 3;

LP_LUA_ISDEVICE_SWITCH = 4;

LP_LUA_ISDEVICE_ROUTER = 5;

LP_LUA_ISDEVICE_PRINTER = 6;

LP_LUA_ISDEVICE_PHONE = 7;

LP_LUA_MAC

String

The MAC address discovered par LoriotPro for this host (it can be a wrong MAC address if the host is not on the same broadcast domain) Format : "xx:xx:xx:xx:xx:xx:"

LP_IP_SWITCH

 

The IP address of the switch to which the host is connected

LP_IP_SWITCH_INDEX

 

The index of the interface of the switch to which the host is connected

LP_LUA_POLLING

 

The polling interval in en seconds

LP_LUA_NUMBER_STATUS_3

 

Number of retries (ping or snmp ping) before changing the connectivity status to 3 (Yellow). Must be lower than the retry count of status 4).

LP_LUA_NUMBER_STATUS_4

 

Number of retries (ping or snmp ping) before changing the connectivity status to 4 (Red). Must be higher than the retry count of status 3).

LP_LUA_IPFORWARDING

 

1 if the host is a router else 0

LP_LUA_IPNEXTHOP

 

1 if the host is a router else 0

LP_LUA_DISCOVERSCANNING

 

1 if the host is used by the discover process else 0.

LP_LUA_SYSSERVICES

 

The SNMP SysServices object value.

LP_LUA_DOUBLECLICK

 

The character string defining the action of the double click on the host description in the directroy. Warning the double click on the icon has a different effect.

LP_LUA_IPSCANNER_STRATEGIE

 

The strategy used for this host by the IP Scanner.

LP_LUA_IPSCANNER_INTERVAL

 

The minimum time between two IPExpert audit process launches.

LP_LUA_FLAG_IPSCANNER

 

‘0’ disable, ‘1’ enable the scan of this host by the IPExpert discover process.

LP_LUA_FLAG_IPSCANNER_NOCONFIG

 

‘0’ disable, ‘1’ enable the IPExpert to modify the settings of this device.

LP_LUA_FLAG_IPSCANNER_EVENT

 

The Event number used by the IPExpert process for sending an alarm

LP_LUA_FLAG_IPSCANNER_EVENT_LEVEL

 

The level (severity and color) of this event (0 à 10)

LP_LUA_STATUS

 

0 to 4

LP_LUA_SLA

 

‘0’ disable, ‘1’ enable the collect of data for the sevice level agreement reporting

Quality of Service control (availability and performance - SLA)

LP_LUA_CRITICITY

 

The level of criticity for this host

LP_LUA_CRITICITY_EVENT

 

The event send when the criticity level is reach

LP_LUA_IP_DDNS_NAME

 

The DNS name of this host, Example : www.guest.com

LP_LUA_IP_DDNS_STATUS

 

‘0’ disable, ‘1’ enable the Dynamique DNS resolution (see Dynamic DNS To IP)

LP_LUA_IP_DDNS_RESOLVE

 

The DDNS name, require that LP_LUA_IP_DDNS_STATUS = 1 and LP_LUA_IP_DDNS_NAME defined.

LP_LUA_IP_CHANGE

 

Change the IP address of the host. 

Warning ! This option can generate important misbehavior of the LoriotPro software in case of duplicate adress in the directory.

value - The new value to assign.

Return Values

result =1 or nil if an error occurs

Example

lp_value=0;
lp_buffer="ok";
dofile(lp.GetPath().."/config/script/loriotinit.lua");

if lp.GetIPInformation(lp_host,"array") then
lp.Trace(array.name);
end
lp.SetIPOption(lp_host,LP_LUA_NAME,"bob");
if lp.GetIPInformation(lp_host,"array") then
lp.Trace(array.name);
end


 



www.loriotpro.com