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

XLUA scripts for remote WEB access

The XLUA script provide access to LoriotPro ressources throught the internal WEB server. They all return XML contains.

Global information

LP_Get_Global_Information.xlua Collect general information about the monitoring software
LP_Get_USER_Information.xlua Collect information related to a specific user

Active View

LP_Create_AV_IP.xlua Create an image from a template of active view
LP_Create_AV_IP_UID.xlua  

Directory access

LP_List_Hosts.xlua Give a list of all devices stored in the directory.
LP_Create_Container.xlua Create a container object in the Directory Tree.
LP_Create_Device.xlua Create a new device (host in the LoriotPro terminology) in the directory tree.
LP_Create_Directory_Tree.xlua Generate an XML File with all the directory objects
LP_Create_Directory_Tree_F.xlua Generate an XML File compatible with the QJUERY plugin JSTREE.
LP_Create_Network.xlua Create a new network object in the directory tre
LP_Delete_IP.xlua Delete a host selected by its IP address
LP_Delete_UID.xlua Delete any object selected by its UID
LP_Edite_IP.xlua Change the value of host object selected by its IP address
LP_Edite_IP_UID.xlua Change the value of host object selected by its UID address
LP_Edite_Network.xlua  
LP_Exist_UID.xlua Check existence of an UID in the directory
LP_GET_IP_UID_VALUES.xlua Retrieve arbitrary values stored within a directory object
LP_GET_IP_UID_Informations.xlua Retrieve the device information stored in the directory
   

Status Monitoring

LP_Create_GRAPH_BAR_STATUS.xlua Create a bar chart displaying the device status distribution in % for the selected container (directory branch).
LP_Create_GRAPH_PIE_STATUS.xlua Create a pie chart displaying the device status distribution in % for the selected container (directory branch).
LP_GET_Container_Hosts_Status.xlua Display a list of devices and their current polling status

Event Traps Syslog

LP_GET_IP_UID_Events_Stats.xlua Retrieve the event of a selected device and provide statitsics as graph in % per type or in % per level
LP_GET_IP_UID_Events.xlua Retrieve a list of events for a specific host. Filter can be applied on event, per contains, per number or per date
LP_GET_IP_UID_Traps.xlua Retrieve the list of SNMP TRAP sent by the selected device

SNMP

LP_SNMP_GETS_IP_UID.xlua  
LP_SNMP_ROWS_IP_UID.xlua Retrieve the row(s) of a SNMP table
LP_SNMP_SET_IP_UID.xlua Change the value of a SNMP object on the specified device
LP_SNMP_SET_IP_UID.xlua Change the value of a SNMP object on the specified device
LP_SNMP_TABLE_IP_UID.xlua Retrieve a SNMP table on the specified device

 

 

Script file Parameters
Global information
LP_Get_Global_Information.xlua

Parameters

No parameter

Examples

Example: http://127.0.0.1:8010/hlua/LP_Get_Global_Information.xlua

LP_Get_USER_Information.xlua

Parameters

No parameter

Examples

Example: http://127.0.0.1:8010/hlua/LP_Get_USER_Information.xlua

Active View

LP_Create_AV_IP.xlua

Create an image from a template of active view

Parameters

IP IP host address
CMP The Active View template located into bin/config/active-view/tlp/ with no extension
W Width
H Height
check if = 1 check if IP is responding to snmp ping

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_AV_IP.xlua?IP=127.0.0.1&CMP=server_02&check=1

LP_Create_AV_IP_UID.xlua

Create an image from a template of active view

Parameters

IP IP host address
CMP The Active View template located into bin/config/active-view/tlp/ with no extension
W Width
H Height
check if = 1 check if IP is responding to snmp ping

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_AV_IP.xlua??UID=5700804808894578689&CMP=server_02&check=1

Directory Access

LP_List_Hosts.xlua

Give a list of all devices stored in the directory. Provide Host Name, IP address and UID

Parameters

No parameter

Examples

Example: http://127.0.0.1:8010/hlua/LP_List_Hosts.xlua

LP_Create_Container.xlua

Create a container object in the Directory Tree.

The UID should be also a container

Type could be : COUNTRY, ORGANIZATION,ORGANISATION UNIT

Parameters

UID The UID of the father object in the directory tree
type The device type
-- LP_LUA_DT_COUNTRY=1;
-- LP_LUA_DT_ORGANIZATION =2;
-- LP_LUA_DT_ORGANIZATION_UNIT=3;
name The name assigned to this new container (encoding="ISO-8859-1")

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_Container.xlua?UID=5700804808894578689&name=MyNewDevic&type=3

LP_Create_Device.xlua

Create a new device (host in the LoriotPro terminology) in the directory tree.

Parameters

UID The UID of the father object in the directory tree
type

The device type, a number defining one of the below options:
AUTO = 0, HOST = 1, SERVER = 2, HUB = 3, SWITCH = 4, ROUTER = 5, PRINTER = 6, PHONE = 7;

name the Device name
IP the IP address of the device

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_Container.xlua?UID=5700804808894578689&name=MyNewDevic&type=3

LP_Create_Directory_Tree.xlua

Generate an XML File with all the directory object

Parameters

UID

The UID of the branch object that become the root of the generated tree.
Set to 0 if the tree is generated from the root.
By default the root is selected

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_Directory_Tree.xlua?UID=5690811270400311300

LP_Create_Directory_Tree_F.xlua

Generate an XML File compatible with the QJUERY plugin JSTREE. This one is used to generate a tree structure.

Parameters

UID

The UID of the branch object that become the root of the generted tree.
Set to 0 if the tree is generated from the root.
By default the root is selected

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_Directory_Tree_F.xlua?UID=5690811270400311300

LP_Create_Network.xlua

Create a new network object in the directory tree

Parameters

UID The UID of the father object in the directory tree
type The network type see below
name The network name (encoding="ISO-8859-1")
description The network description (encoding="ISO-8859-1")
speed The network speed in bit/s
net The network number in the format « x.x.x.x » ex : « 10.0.0.0 »
mask The network mask in the format « x.x.x.x » ex : « 255.0.0.0 »

Examples

Example: http://127.0.0.1:8010/hlua/LP_create_Network.xlua?UID=5700804808894578689&name=net01&type=6&speed=100000000&net=10.10.10.0&mask=255.255.255.0&description=my network

LP_Delete_IP.xlua

Delete a host selected by its IP address

Parameters

IP IP address of the host to delete

Examples

Example: http://127.0.0.1:8010/hlua/LP_Delete_IP.xlua?IP=187.1.1.9

LP_Delete_UID.xlua

Delete any object selected by its UID

Parameters

UID The UID of the directory object to delete

Examples

Example: http://127.0.0.1:8010/hlua/LP_Delete_UID.xlua?UID=5700804808894578689

LP_Edite_Container.xlua

 

Parameters

UID The container UID to edit
DIRECTORY_NAME The new name to assign --encoding="ISO-8859-1"
DIRECTORY_PLUGIN_NAME The new plugin name--encoding="ISO-8859-1"
DIRECTORY_STRING The description--encoding="ISO-8859-1"

Examples

-- Warning ! The items of the directory that are plugins uses LP_LUA_DIRECTORY_PLUGIN_NAME as name in the directory.
-- Audit plugin items, TCP polling items, MRTG graph item, hosts and container use the property LP_LUA_DIRECTORY_NAME.
-- Warning ! The name of objects is sometimes not accessible when they are locked by LoriotPro.

--http://127.0.0.1:8010/hlua/LP_Edite_Container.xlua?UID=3333333&DIRECTORY_NAME=my name

LP_Edite_IP.xlua

Change the settings of host object selected by its IP address

Parameters

IP -- IP to set
NAME

The device name in the LoriotPro directory

COMMUNITYRO

The SNMP ReadOnly community

COMMUNITYRW

The SNMP ReadWrite community

USER1

The user 1 variable

USER2

The user 2 variable

USER3

The user 3 variable

SYSID

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

SYSNAME

The SNMP name (SNMP object sysname)

GROUPREF

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

POLLING_SNMP

‘0’ disable, ‘1’ enable

POLLING_PING 0’ disable, ‘1’ enable
POLLING
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;

STATUS

0 to 4 -(0, purple, 1 blue, 2 green, 3 yellow, 4 red)

MAC

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:"

IP_SWITCH

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

IP_SWITCH_INDEX

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

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

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

IP_DDNS_RESOLVE

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

IP_DDNS_NAME

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

IP_DDNS_STATUS

‘0’ disable, ‘1’ enable the Dynamique DNS resolution (see

IP_CHANGE

Change the IP address of the host.

CRITICITY

The level of criticity for this host

CRITICITY_EVENT

The event send when the criticity level is reach

FLAG_IPSCANNER

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

IPSCANNER_INTERVAL

The minimum time between two IPExpert audit process launches.

IPSCANNER_STRATEGIE

The strategy used for this host by the IP Scanner.

DOUBLECLICK Action on double click
IPFORWARDING

1 if the host is a router else 0

IPNEXTHOP

1 if the host is a router else 0

DISCOVERSCANNING

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

SYSSERVICES

The SNMP SysServices object value.

NET_IPSCANNER
NET_DESCRIPTION
NET_NAME
NET_STRATEGY
NET_IPSCANNER_INTERVAL
SLA
FLAG_IPSCANNER_NOCONFIG
IPSCANNER_EVENT
IPSCANNER_EVENT_LEVEL
SNMPVERSION

Examples

http://127.0.0.1:8010/hlua/LP_Edite_IP.xlua?IP=187.1.1.9&POLLING_PING=1&POLLING=15

LP_Edite_IP_UID.xlua

Change the value of host object selected by its UID address

Parameters

Same option as LP_Edite_IP.xlua but selector is UID instead of IP address

Examples

http://127.0.0.1:8010/hlua/LP_Edite_IP_UID.xlua?UID=5701578723346612242&POLLING_PING=1&POLLING=15

LP_Edite_Network.xlua

Parameters

Examples

--http://127.0.0.1:8010/hlua/LP_Edite_Network.xlua?net=10.10.10.0&mask=255.255.255.0&NET_DESCRIPTION=my network01

LP_Exist_UID.xlua

Check existence of an UID in the directory

Parameters

UID The UID to check

Examples

Example :http://127.0.0.1:8010/hlua/LP_Exist_UID.xlua?UID=3333333

LP_GET_IP_UID_VALUES.xlua

Retrieve arbitrary values stored within a directory object

Parameters

  UID The UID of the device (host)
  IP The IP address of the device (host)

Examples

--http://127.0.0.1:8010/hlua/LP_GET_IP_UID_VALUES.xlua?IP=192.168.0.8
--http://127.0.0.1:8010/hlua/LP_GET_IP_UID_VALUES.xlua?UID=5703407374392360971
Select an UID
Select an IP

LP_GET_IP_UID_Informations.xlua

Retrieve the device information stored in the directory

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)

Examples

Example: http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Informations.xlua?IP=192.168.0.8
Example: http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Informations.xlua?UID=5703407374392360971

Status Monitoring


LP_Create_GRAPH_BAR_STATUS.xlua

Create a bar graph displaying the device status distribution in % for the selected container (directory branch).

 

Parameters

UID The UID of the container object (branch) in the directory tree where to select the devices for the calculation
W --Width of the generated image
H --Height of the generated image
title Title given to the graph --encoding="ISO-8859-1"

Examples

Example : http://127.0.0.1:8010/hlua/LP_Create_GRAPH_BAR_STATUS.xlua?UID=0&W=1000&title=my status graph
LP_Create_GRAPH_PIE_STATUS.xlua

Parameters

UID The UID of the container object (branch) in the directory tree where to select the devices for the calculation
W --Width of the generated image
H --Height of the generated image
title Title given to the graph --encoding="ISO-8859-1"

Examples

Example: http://127.0.0.1:8010/hlua/LP_Create_GRAPH_PIE_STATUS.xlua?UID=0&W=1000&title=my status graph

LP_GET_Container_Hosts_Status.xlua

Parameters

UID container UID

Examples

--http://127.0.0.1:8010/hlua/LP_GET_Container_Hosts_Status.xlua?UID=3333333

Event Traps Syslog

LP_GET_IP_UID_Events_Stats.xlua

Retrieve the event of a selected device and provide statitsics as graph in % per type or in % per level

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)
graph 1 for event graph, 2 for level graph
day 01-31
month 01-12
year 2012

Examples

--http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Events_Stats.xlua?IP=127.0.0.1
--http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Events_Stats.xlua?UID=5703407374392360971

LP_GET_IP_UID_Events.xlua

Retreive a list of events for a specific host. Filter can be applied on event, per contains, per number or per date

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)
event number  
search search string

Examples

Example : http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Events.xlua?IP=127.0.0.1&event=101
Example : http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Events.xlua?UID=5703407374392360971

LP_GET_IP_UID_Traps.xlua

Retrieve the list of SNMP TRAP sent by the selected device

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)
search search string, if nil get all

Examples

Example:http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Traps.xlua?IP=127.0.0.1&event=101
Example :http://127.0.0.1:8010/hlua/LP_GET_IP_UID_Traps.xlua?UID=5703407374392360971
SNMP
LP_SNMP_GETS_IP_UID.xlua

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)
GETS the string in correct format to gets values

Examples

Example: http://127.0.0.1:8010/hlua/LP_SNMP_GETS_IP_UID.xlua?IP=192.168.0.8&GETS=syslocation,syscontact
Example: http://127.0.0.1:8010/hlua/LP_SNMP_GETS_IP_UID.xlua?UID=5703407374392360971&GETS=syslocation,syscontact

LP_SNMP_ROWS_IP_UID.xlua

Retreive the row(s) of a SNMP table

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)
ROWS the string name of the table

Examples

Example: http://127.0.0.1:8010/hlua/LP_SNMP_ROWS_IP_UID.xlua?IP=192.168.0.8&ROWS=ifinoctet
Example: http://127.0.0.1:8010/hlua/LP_SNMP_ROWS_IP_UID.xlua?UID=5703407374392360971&ROWS=ifentry

LP_SNMP_SET_IP_UID.xlua

Change the value of a SNMP object on the specified device

Parameters

UID  
IP The IP address of the device (host)
SET

the string in correct format to set values

syntax : Oidname.index/(type)value

possible types:
(nu) NUL
(id) Object ID
(hs) Hexa string
(os) Octet string
(in) Integer
(ip) IP adresse
(co) Counter
(ga) Gauge
(ti) Timeticks

Examples

Example: http://127.0.0.1:8010/hlua/LP_SNMP_SET_IP_UID.xlua?IP=192.168.0.8&SET=syslocation/(os)Here and nothing else
Example: http://127.0.0.1:8010/hlua/LP_SNMP_SET_IP_UID.xlua?UID=5703407374392360971&SET=syslocation/(os)My Home,syscontact/(os)Support

LP_SNMP_TABLE_IP_UID.xlua

Retrieve a SNMP table on the specified device

Parameters

UID The UID of the device (host)
IP The IP address of the device (host)
TABLE

the string name of the table

Examples

Example: http://127.0.0.1:8010/hlua/LP_SNMP_TABLE_IP_UID.xlua?IP=192.168.0.8&TABLE=ifentry
Example: http://127.0.0.1:8010/hlua/LP_SNMP_TABLE_IP_UID.xlua?UID=5703407374392360971&TABLE=ifentry


www.loriotpro.com