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.GetIPFromMAC - Search a host in directory from its MAC address

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

ip = lp.GetIPFromMAC("mac_adresse");

Description

Search a MAC address in the LoriotPro directory and get the IP address of the host with this MAC address

Parameters

"mac_adresse" - A MAC address in a character string format ("aa:ee:ee:ee:ee:10").

Return Values

ip - the IP adress of the host or nil

Example

p = lp.GetIPFromMAC("00:07:CB:0A:6A:49");

 

if (ip) then

lp.Print("Found IP : ", ip,"\n");

else

lp.Print("Not Found IP \n");

end

ip = lp.GetIPAddress("00:07:CC:0A:DE:49");

 

if (ip) then

lp.Print("Found IP : ", ip,"\n");

else

lp.Print("Not Found IP \n");

end

In this example we use the MAC address known in the Directory: ‘00:07:CB:0A:6A:49’  , and one unkown ‘00:07:CC:0A:DE:49’.

get ip from mac

get ip from mac with lua

 

 


www.loriotpro.com