|
|
@ -10,6 +10,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
</plugin>
|
|
|
|
</plugin>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<aliases>
|
|
|
|
|
|
|
|
<alias
|
|
|
|
|
|
|
|
name="TestAlert"
|
|
|
|
|
|
|
|
match="^tsend$"
|
|
|
|
|
|
|
|
script="sendAlert"
|
|
|
|
|
|
|
|
regexp="y"
|
|
|
|
|
|
|
|
ignore_case="y"
|
|
|
|
|
|
|
|
enabled="y"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
</alias>
|
|
|
|
|
|
|
|
</aliases>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Script -->
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -64,11 +76,16 @@ function pageRequest(req, protocol)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function sendAlert(name, line, wildcards)
|
|
|
|
function sendAlert(name, line, wildcards)
|
|
|
|
for _,v in ipairs(triggerLines) do
|
|
|
|
local wc = wildcards[1] or ""
|
|
|
|
if name == v.name then
|
|
|
|
if name ~= "TestAlert" then
|
|
|
|
msg = string.format(alertFormat, v.message)
|
|
|
|
for _,v in ipairs(triggerLines) do
|
|
|
|
break
|
|
|
|
if name == v.name then
|
|
|
|
|
|
|
|
msg = string.format(alertFormat, v.message .. wc)
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
msg = string.format(alertFormat, "Test notification."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
pageRequest(msg, "HTTPS")
|
|
|
|
pageRequest(msg, "HTTPS")
|
|
|
|
end
|
|
|
|
end
|
|
|
|