Hi,
Something like this should work if i understood your need
local prid = "logmon"
local subsys = "1.1"
local match = string.match
local pattern = ".*Failed\sto\sget.*"
local aoAlarm = alarm.get()
if aoAlarm.prid == prid and aoAlarm.sid == subsys and match(aoAlarm.message, pattern) then
action.close(aoAlarm.nimid)
end
Put this script on AO. And it should "close" any alarm that come and match these three conditions. You can test this script by executing the script yourself (just give a "nimid" in the alarm.get() ).
If you want to dump complete hash use this
local function tdump(t)
local search = pairs;
local sf = string.format;
local sr = string.rep;
local perf_type = type;
local ts = tostring;
local function dmp(t, l, k)
if perf_type(t) == "table" then
print(sf("%s%s:", sr(" ", l*2), ts(k)));
for k, v in search(t) do
dmp(v, l+1, k);
end
else
print(sf("%s%s:%s", sr(" ", l*2), ts(k), ts(t)));
end
end
dmp(t, 1, "root");
end
And use it to dump the aoAlarm hash:
tdump(aoAlarm)
Best Regards,
Thomas