The location of the lua scripts is /usr/lib/lua/spc-gateway and the names are email-custom.lua, nma-custom.lua and prowl-custom.lua. The scripts are only available via ssh and scp.
Example - If you would like to customize the Alarm Activate and Deactivate messages to get following notifications:
13:10 Alarm is activated by John
17:43 Alarm is deactivated by John
You can modify the lua code according to:
Code: Select all
if #arg ~= 5 then
return "",""; -- Wrong number of input parameters
end
local timestamp = arg[1];
local etype = arg[2];
local sia = arg[3];
local edescr = arg[4];
local eattr = arg[5];
local timestr = os.date("%Y-%m-%d %H:%M:%S", timestamp);
local stime = os.date("%H:%M", timestamp);
local subject = "My SPC Gateway Event";
local message = "Following event has occured: \n " .. timestr .. " - " .. etype .. "[" .. sia .. "], " .. edescr .. ", " .. eattr;
if sia == 'CL' then
message = stime .. " Alarm is activated by " .. edescr;
end
if sia == 'OP' then
message = stime .. "Alarm is deactivated by " .. edescr;
end
return subject, message;