Last change
on this file since 17833 was 17615, checked in by Daniela Dorner, 11 years ago |
added sending email in case there were warnings about full disks
|
-
Property svn:executable
set to
*
|
File size:
1.3 KB
|
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 |
|
---|
7 | source `dirname $0`/../Sourcefile.sh
|
---|
8 | printprocesslog "INFO starting $0"
|
---|
9 |
|
---|
10 | lasthour=`date +'%F %H' --date="-1hour"`
|
---|
11 |
|
---|
12 | processlogfile=$processlogpath/process`date +%F --date="-1hour"`.log
|
---|
13 |
|
---|
14 | if grep -E "^$lasthour.*WARN" $processlogfile >/dev/null
|
---|
15 | then
|
---|
16 | grep -E "^$lasthour.*WARN" $processlogfile | mail -s 'found warnings in '$processlogfile $erradrs
|
---|
17 | printprocesslog "INFO sent warnings to "$erradrs
|
---|
18 | fi
|
---|
19 |
|
---|
20 | if grep -E "^$lasthour.*ERROR" $processlogfile >/dev/null
|
---|
21 | then
|
---|
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
|
---|
29 | printprocesslog "INFO sent connection-problem info to "$erradrs
|
---|
30 | fi
|
---|
31 |
|
---|
32 | if grep -E "^$lasthour.*DISK" $processlogfile >/dev/null
|
---|
33 | then
|
---|
34 | grep -E "^$lasthour.*DISK" $processlogfile | mail -s 'disk full ('$processlogfile')' $deladrs
|
---|
35 | printprocesslog "INFO sent full-disk info to "$deladrs
|
---|
36 | fi
|
---|
37 |
|
---|
38 | printprocesslog "INFO finished $0"
|
---|
39 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.