Hi!
Perhaps you are thinking in a too complicated way? If I understood your problem correctly, main thing is to receive e-mail in case of an error, not for collecting statistics every 10 minutes?
Why wouldn't you just do something like
tail -f message_log_file | \
awk '/OOM/ { printf "OOM" }
/JAM/ { printf "JAM" } ' | while read LINE
do
# and the mailing part comes here
done
(Or even faster, use sed's regexps).
I haven't tested that, but it should work - and is LOTS lighter than polling the last 2000 lines of a file. Plus, this informs you instantly (well, one second after the file is changed, to be precise).
Regards,
pen