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

Definition file of system variables

LoriotPro provides a set of LUA systeme variables that can be used in any LUA script. The system variables are not accessible by default. To use it , you should add the following line at the beginning of your LUA script.

lp_value = 0;
lp_buffer ="error";

dofile(lp.GetPath().."/config/script/loriotinit.lua");

The directory bin/config/script should contains the file loriotinit.lua


loriotinit.lua

--status
LP_LUA_STATUS_NONE=0
LP_LUA_STATUS_ICMP=1;
LP_LUA_STATUS_SNMP=2;
LP_LUA_STATUS_WARNING=3;
LP_LUA_STATUS_DOWN=4;

--lp setipoption
LP_LUA_NAME=1;
LP_LUA_COMMUNITYRO=2;
LP_LUA_COMMUNITYRW=3;
LP_LUA_USER1=4;
LP_LUA_USER2=5;
LP_LUA_USER3=6;
LP_LUA_SYSID=7;
LP_LUA_SYSNAME=8;
LP_LUA_GROUPREF=9;
LP_LUA_POLLING_SNMP=10;
LP_LUA_POLLING_PING=11;
LP_LUA_POLLING=12;
LP_LUA_ON=1;
LP_LUA_OFF=0;

--lpav object type define --lpav_InsertObject
LPAV_OBJ_WORLD =0;
LPAV_OBJ_COUNTRY =1;
LPAV_OBJ_ORGANIZATION =2;
LPAV_OBJ_ORGANIZATION_UNIT = 3;
LPAV_OBJ_NETWORK =4;
LPAV_OBJ_HOST_1 =6;
LPAV_OBJ_ROUTER =7;
LPAV_OBJ_SHORTCUT_1 =8;
LPAV_OBJ_SHORTCUT_2 =9;
LPAV_OBJ_MRTG =10;
LPAV_OBJ_PLUGIN =11;
LPAV_OBJ_BADPLUGIN = 12;
LPAV_OBJ_LORIOTPRO = 13;
LPAV_OBJ_HOST_2_ROUTER = 15;
LPAV_OBJ_HOST_3_SWITCH =16;
LPAV_OBJ_HOST_4 = 17;
LPAV_OBJ_HOST_5 = 18;
LPAV_OBJ_HOST_6 = 19;
LPAV_OBJ_VIEWPLUGIN =20
LPAV_OBJ_HOST_SERVER = 27;
LPAV_OBJ_HOST_IMPRIMANTE =28;
LPAV_OBJ_HOST_PHONE =29;
LPAV_OBJ_RECT = 30;
LPAV_OBJ_CIRCLE = 31;
LPAV_OBJ_FILL_RECT = 32;
LPAV_OBJ_FILL_CIRCLE = 33;
LPAV_OBJ_H_LINE = 34;
LPAV_OBJ_V_LINE = 35;
LPAV_OBJ_DIR_EMF = 36;
LPAV_OBJ_TEXT = 37;
LPAV_OBJ_FILL_TEXT = 38;
LPAV_OBJ_FULL_RECT = 39;
LPAV_OBJ_FULL_CIRCLE = 40;
LPAV_OBJ_H45_LINE = 41;
LPAV_OBJ_V45_LINE = 42;
LPAV_OBJ_FULL_TEXT = 43;
LPAV_OBJ_BASIC_SHAPE = 44;
LPAV_OBJ_ANALOGIC_METER_01 = 45;
LPAV_OBJ_HOST_HUB = 46;
LPAV_OBJ_CONNECTOR =144;

--lpav.SetOption

LPAV_NAME =1;
LPAV_FONTNAME =2;
LPAV_FONTSIZE =3;
LPAV_LINEWIDTH =4;
LPAV_LINESTYLE =5;
LPAV_EXPRESSION =6;
LPAV_HIDEN_TEXT =7;
LPAV_NOBORDER =8;
LPAV_TEXTMODE =9;
LPAV_TEXTSTYLE =10;
LPAV_UNIT =11 ;
LPAV_OBJECTTYPE =12;
LPAV_POLLING =13;
LPAV_POLLING_INTERVAL =14;
LPAV_SELECTED =15;
LPAV_X =16;
LPAV_X1 =17;
LPAV_Y =18;
LPAV_Y1 =19;
LPAV_TYPE =20;
LPAV_CONNECTED_TO1 =21;
LPAV_CONNECTED_TO2 =22;
LPAV_ISRATIO =23;
LPAV_LEFT_MOUSE_MENU =24;
LPAV_RESULT_IS_TEXT =25;
LPAV_RESULT_IS_NAME =26;
LPAV_REF1 =27;
LPAV_REF2 =28;
LPAV_REF3 =29;
LPAV_REF4 =30;
LPAV_ISCOUNTER =31;
LPAV_CONNECTOR_AUTO_ALIGN =32;
LPAV_NOIPSOURCE_TEST =33;
LPAV_NOSELECTABLE =34;
LPAV_CLIPART =35;
LPAV_STATUS = 36;
LPAV_MAPTYPE =37;

--lpav.SetGlobalOption

LPAV_G_DEFAULTIP =1;
LPAV_G_MAPNAME =2;
LPAV_G_FONTNAME =3;
LPAV_G_FONTSIZE =4;
LPAV_G_FONTITALIC =5;
LPAV_G_LINEWIDTH =6;
LPAV_G_LINESTYLE =7;
LPAV_G_MAX_X =8;
LPAV_G_MAX_Y =9;
LPAV_G_ZOOMAUTO =10;
LPAV_G_ZOOMINDEX =11;

--lpav.InsertAction lpav.InsertMenu

LPAV_ACTION_NONE =0;
LPAV_ACTION_LOADMAP =1;
LPAV_ACTION_WINEXEC =2;
LPAV_ACTION_SHELLEXEC =3;
LPAV_ACTION_PLUGIN =4;
LPAV_ACTION_TABLE =5;
LPAV_ACTION_SCRIPT =6;
LPAV_ACTION_SCI =7;
LPAV_ACTION_FOUND_INDIR =8;
LPAV_ACTION_MODAL_MAP =9;
LPAV_ACTION_SET_OID =10;
LPAV_ACTION_CLEAR_EVENTREF =11;
LPAV_ACTION_CLEAR_EVENTFILTER =12;
LPAV_ACTION_CLEAR_TRAPFILTER =13;
LPAV_ACTION_CLEAR_EVENTGENERATED =14;
LPAV_ACTION_CLEAR_TRAPGENERATED =15;
LPAV_ACTION_CLEAR_TRAPREF =16;

--lpav.InsertFilter
LPAV_FILTER_CONDITION_EGAL =0;
LPAV_FILTER_CONDITION_SUP =1;
LPAV_FILTER_CONDITION_INF =2;
LPAV_FILTER_CONDITION_DIF =3;
LPAV_FILTER_CONDITION_SUP_EGAL =4;
LPAV_FILTER_CONDITION_INF_EGAL =5;
LPAV_FILTER_CONDITION_FIND =6;
LPAV_FILTER_CONDITION_BAD_EXPRESSION =7;
LPAV_FILTER_CONDITION_ANY =8;

function DisplayIPInformation (ip)
lp_value=lp_GetIPInformation(ip,"aa"); if lp_value then lp_Trace("Name>"..aa.name); lp_Trace("Session>//////////////////////////////////////////////////"); lp_Trace("IP>"..aa["ip"]); lp_Trace("ip_add>"..aa["ip_add"]); lp_Trace("name>"..aa["name"]); lp_Trace("status>"..aa["status"]); lp_Trace("communityro>"..aa["communityro"]); lp_Trace("communityrw>"..aa["communityrw"]); lp_Trace("user1>"..aa["user1"]); lp_Trace(aa["user2"]); lp_Trace(aa["user3"]); lp_Trace(aa["sysid"]); lp_Trace(aa["sysname"]); lp_Trace(aa["groupref"]); lp_Trace(aa["isinrepair"]); lp_Trace(aa["trapgenerated"]); lp_Trace(aa["sla"]); lp_Trace(aa["ri_ifgraph"]); lp_Trace(aa["ri_ifinoctets_p"]); lp_Trace(aa["ri_ifoutoctets_p"]); lp_Trace(aa["snmppooling"]); lp_Trace(aa["pingpooling"]); lp_Trace(aa["timeslast"]); lp_Trace(aa["UID"]);
end
end

function DisplayUID( uid)
lp_value=lp_GetUIDInformation(uid,"aaa");
if lp_value then
lp_Trace("UID>"..uid.."//////////////////////////////////////////////////");
lp_Trace("name>"..uid,aaa.name);
lp_Trace("status>"..uid,aaa.status);
lp_Trace("plugin_name>"..uid,aaa.plugin_name);
lp_Trace("object_type"..uid,aaa.object_type);
lp_buffer =aaa.name;
else
lp_buffer ="#ERROR";
end
end

 

 

 


www.loriotpro.com