01.10.2022, 17:43
Hi
Is it possible to email/pushover error log whenever a new error log entry comes?
Is it possible to email/pushover error log whenever a new error log entry comes?
Pushover/email error log
|
01.10.2022, 17:43
Hi
Is it possible to email/pushover error log whenever a new error log entry comes?
10.10.2022, 11:35
Is it possible?
10.10.2022, 11:35
What kind of errors do you want to catch? Errors from scripts?
10.10.2022, 12:19
if error log gets a new entry, so I was thinking all new entries.
11.10.2022, 10:26
Run this as a scheduled scripts that runs once every minute. Replace log call with email/pushover etc.
Code: 123456789101112131415161718 stmaxid = storage.get('errorsmaxid', 0)
dbmaxid = db:getone('SELECT MAX(id) FROM errors') or 0
if stmaxid == dbmaxid then
return
elseif dbmaxid < stmaxid then
stmaxid = 0
end
rows = db:getall('SELECT * FROM errors WHERE id>?', stmaxid)
for _, row in ipairs(rows) do
stmaxid = math.max(stmaxid, row.id)
errordate = os.date('%c', row.errortime)
log(errordate, row.scriptname, row.errortext)
end
storage.set('errorsmaxid', stmaxid)
13.10.2022, 07:11
Works perfect as always
![]() |
« Next Oldest | Next Newest »
|