source: trunk/DataCheck/Monitoring/CheckLogs.sh@ 16424

Last change on this file since 16424 was 13063, checked in by Daniela Dorner, 13 years ago
added (script to check global logfile for errors and warnings)
  • Property svn:executable set to *
File size: 697 bytes
Line 
1#!/bin/bash
2#
3# This script checks, if there are WARNs or ERRORs in the processlog of
4# the last night and sends them to the emailadresse(s) in $erradr
5#
6
7source `dirname $0`/../Sourcefile.sh
8printprocesslog "INFO starting $0"
9
10oldprocesslog=$processlogpath/process`date +%F --date="-1day"`.log
11
12if grep WARN $oldprocesslog >/dev/null
13then
14 grep WARN $oldprocesslog | mail -s 'found warnings in '$oldprocesslog $erradrs
15 printprocesslog "INFO sent warnings to "$erradrs
16fi
17
18if grep ERROR $oldprocesslog >/dev/null
19then
20 grep ERROR $oldprocesslog | mail -s 'found errors in '$oldprocesslog $erradrs
21 printprocesslog "INFO sent errors to "$erradrs
22fi
23
24printprocesslog "INFO finished $0"
25
Note: See TracBrowser for help on using the repository browser.