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.GetIPInformation - Get the properties of a Host

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.GetIPInformation(ip,arrayname);

Description

Collecte the configuration parameters stored in the directory and associated to this Host IP address

Parameters

ip - The IP address in a charater string format.

arrayname - A variable name in a charater string format for an array of values.

Return Values

Result =1 or nil if an error occurs

If result =1 returns arrayname

Array variable description

arrayname['ip'] The IP address of the host in a character string format
arrayname['ip_add'] The IP address of the host in an INTEGER format
arrayname['name'] The Host name in a character string format
arrayname['status'] The current Host connectivity status (value: 0,1,2,3,4)(The color of host icon)
arrayname['communityro'] The snmp read only community of the host
arrayname['communityrw'] The snmp read write community of the host
arrayname['user1'] The user defined parameter 1 field value
arrayname['user2'] The user defined parameter 2 field value
arrayname['user3'] The user defined parameter 3 field value
arrayname['sysid'] The snmp sysid of the host in a character string format
arrayname['sysname'] The snmp sysname value in a character string format
arrayname['isinrepair'] The current maintenance status (1 in maintenance else 0)
arrayname['received'] The number of received trap from this host
arrayname['sla'] 1 if the SLA collection is running
arrayname['ri_ifgraph'] 1 if the bandwith load value collection is running
arrayname['ri_ifinoctets_p'] Interface load in % of total bandwith for incoming packets
arrayname['ri_ifoutoctets_p'] Interface load in % of total bandwith for outgoing packets
arrayname['snmppolling'] SNMP polling is running
arrayname['pingpolling'] Ping polling is running
arrayname['timesfirst'] Timestamp of the last sent polling packet
arrayname['timeslast'] Timestamp of the last received polling packet
arrayname['UID'] UID of the host, a unique 64 bits number that identify this host in the directory

Exemple

 

lp_value=0;
lp_buffer="ok";
--a=lp.GetFirstIP();
--if a~= nil then
if lp.GetIPInformation(lp_host,"array") then
lp.Trace(array.name);
lp.Trace(array.ip);
lp.Trace(array.ip_add);
lp.Trace(array.name);
lp.Trace(array.status);
lp.Trace(array.communityro);
lp.Trace(array.communityrw);
lp.Trace(array.user1);
lp.Trace(array.user2);
lp.Trace(array.user3);
lp.Trace(array.sysid);
lp.Trace(array.sysname);
lp.Trace(array.isinrepair);
lp.Trace(array.trapreceived);
lp.Trace(array.sla);
lp.Trace(array.ri_ifgraph);
lp.Trace(array.ri_ifinoctets_p);
lp.Trace(array.ri_ifoutoctets_p);
lp.Trace(array.snmppolling);
lp.Trace(array.pingpolling);
lp.Trace(array.timesfirst);
lp.Trace(array.timeslast);
end
--end


lp_value=0;
lp_buffer="ok";
if lp.GetIPInformation(lp_host,"array") then
if array.status==2 then
lp.Trace("host polled in snmp ", lp.Get(lp_host,"sysname"))
end;
end




www.loriotpro.com