// TODO
#! /bin/bash
echo "monitoring log files"
if grep SQLSTATE application-cronjob-*-`date +"%Y-%m-%d"`.log ;
then
echo "sending mail"
grep -10 SQLSTATE application-cronjob-*-`date +"%Y-%m-%d"`.log | mail -s "errors found in logs for `date +"%Y-%m-%d"` example@example.com
fi
Friday, July 13, 2018
To setup a simple log monitoring script
Posted by Reddy at 11:43 AM
Labels: bash, monitoring, Unix
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment