agende esse script para ser executado a cada 5 ou 10 minutos.
ele apenas compara o alerta antigo com a nova contagem dos registros.
altere o DB_LOG_FILE e seu ID de e-mail no script
#!/bin/bash
EXTRACT_FILE=/tmp/$(date +%Y%m%d).txt
touch ${EXTRACT_FILE}
DB_LOG_FILE=/tmp/db.log
PREV_COUNT=$(wc -l < ${EXTRACT_FILE})
grep "000451" ${DB_LOG_FILE} > ${EXTRACT_FILE}
CURRENT_COUNT=$(wc -l < ${EXTRACT_FILE})
if [ "${PREV_COUNT]" -ne "${CURRENT_COUNT}" ]
then
mail -s "Database Error Found" "[email protected]" < ${EXTRACT_FILE}
else
echo "No new alerts"
fi