]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/check_for_zombie_jobs
Fix config of regexwhere-test
[bacula/bacula] / regress / scripts / check_for_zombie_jobs
1 #!/bin/sh
2 #
3 # Check for zombie jobs (not terminated).
4 # Also scan logs for ERROR messages
5 #
6
7 # check_for_zombie_jobs storage=STORAGE [client=localhost-fd]
8
9 if [ $# = 2 ] ; then
10     client="$2"
11 else 
12     client="client"
13 fi
14
15 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
16 @output tmp/dir.out
17 status dir
18 @output tmp/fd.out
19 status $client
20 @output tmp/sd.out
21 status $1
22 @output
23 quit
24 END_OF_DATA
25 grep "No Jobs running." tmp/dir.out 2>&1 >/dev/null
26 if [ $? != 0 ] ; then
27   echo " "
28   echo "  !!!! Zombie Jobs in Director !!!!"
29   echo "  !!!! Zombie Jobs in Director !!!!" >>test.out
30   echo " "
31 fi
32 grep "No Jobs running." tmp/fd.out 2>&1 >/dev/null
33 if [ $? != 0 ] ; then
34   echo " "
35   echo "  !!!! Zombie Jobs in File daemon !!!!"
36   echo "  !!!! Zombie Jobs in File daemon !!!!" >>test.out
37   echo " "
38 fi
39 grep "No Jobs running." tmp/sd.out 2>&1 >/dev/null
40 if [ $? != 0 ] ; then
41   echo " "
42   echo "  !!!! Zombie Jobs in Storage daemon !!!!"
43   echo "  !!!! Zombie Jobs in Storage daemon !!!!" >>test.out
44   echo " "
45 fi
46 grep "ERROR" tmp/log*.out 2>&1 >/dev/null
47 if [ $? = 0 ] ; then
48   echo " "
49   echo "  !!!! ERROR in log output !!!!"
50   echo "  !!!! ERROR in log output !!!!" >>test.out
51   echo " "
52 fi
53 grep "Fatal Error" tmp/log*.out 2>&1 >/dev/null
54 if [ $? = 0 ] ; then
55   echo " "
56   echo "  !!!! Fatal Error in log output !!!!"
57   echo "  !!!! Fatal Error in log output !!!!" >>test.out
58   echo " "
59 fi
60
61 grep "glibc detected" tmp/log*.out 2>&1 >/dev/null
62 if [ $? = 0 ] ; then
63   echo " "
64   echo "  !!!! glibc detected Error in log output !!!!"
65   echo "  !!!! glibc detected Error in log output !!!!" >>test.out
66   echo " "
67 fi
68