Changeset 17593 for trunk/DataCheck/Monitoring
- Timestamp:
- 03/02/14 01:08:32 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Monitoring/CheckLogs.sh
r13063 r17593 8 8 printprocesslog "INFO starting $0" 9 9 10 oldprocesslog=$processlogpath/process`date +%F --date="-1day"`.log 10 lasthour=`date +'%F %H' --date="-1hour"` 11 11 12 if grep WARN $oldprocesslog >/dev/null 12 processlogfile=$processlogpath/process`date +%F --date="-1hour"`.log 13 14 if grep -E "^$lasthour.*WARN" $processlogfile >/dev/null 13 15 then 14 grep WARN $oldprocesslog | mail -s 'found warnings in '$oldprocesslog$erradrs16 grep -E "^$lasthour.*WARN" $processlogfile | mail -s 'found warnings in '$processlogfile $erradrs 15 17 printprocesslog "INFO sent warnings to "$erradrs 16 18 fi 17 19 18 if grep ERROR $oldprocesslog>/dev/null20 if grep -E "^$lasthour.*ERROR" $processlogfile >/dev/null 19 21 then 20 grep ERROR $oldprocesslog | mail -s 'found errors in '$oldprocesslog $erradrs 22 grep -E "^$lasthour.*ERROR" $processlogfile | mail -s 'found errors in '$processlogfile $erradrs 23 printprocesslog "INFO sent errors to "$erradrs 24 fi 25 26 if grep -E "^$lasthour.*CONNECTION" $processlogfile >/dev/null 27 then 28 grep -E "^$lasthour.*CONNECTION" $processlogfile | mail -s 'found connection problems found ($processlogfile)' $erradrs 21 29 printprocesslog "INFO sent errors to "$erradrs 22 30 fi
Note:
See TracChangeset
for help on using the changeset viewer.