Ignore:
Timestamp:
03/02/14 01:08:32 (11 years ago)
Author:
Daniela Dorner
Message:
changed to hourly checking and added special case for connection problems
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Monitoring/CheckLogs.sh

    r13063 r17593  
    88printprocesslog "INFO starting $0"
    99
    10 oldprocesslog=$processlogpath/process`date +%F --date="-1day"`.log
     10lasthour=`date +'%F %H' --date="-1hour"`
    1111
    12 if grep WARN $oldprocesslog >/dev/null
     12processlogfile=$processlogpath/process`date +%F --date="-1hour"`.log
     13
     14if grep -E "^$lasthour.*WARN" $processlogfile >/dev/null
    1315then
    14    grep WARN $oldprocesslog | mail -s 'found warnings in '$oldprocesslog $erradrs
     16   grep -E "^$lasthour.*WARN" $processlogfile | mail -s 'found warnings in '$processlogfile $erradrs
    1517   printprocesslog "INFO sent warnings to "$erradrs
    1618fi
    1719
    18 if grep ERROR $oldprocesslog >/dev/null
     20if grep -E "^$lasthour.*ERROR" $processlogfile >/dev/null
    1921then
    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
     24fi
     25
     26if grep -E "^$lasthour.*CONNECTION" $processlogfile >/dev/null
     27then
     28   grep -E "^$lasthour.*CONNECTION" $processlogfile | mail -s 'found connection problems found ($processlogfile)' $erradrs
    2129   printprocesslog "INFO sent errors to "$erradrs
    2230fi
Note: See TracChangeset for help on using the changeset viewer.