]> git.sur5r.net Git - bacula/bacula/blob - regress/scripts/check_for_zombie_jobs
exit on failure
[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
26 grep "No Jobs running." tmp/dir.out 2>&1 >/dev/null
27 if [ $? != 0 ] ; then
28   echo " "
29   echo "  !!!! Zombie Jobs in Director !!!!"
30   echo "  !!!! Zombie Jobs in Director !!!!" >>test.out
31   echo " "
32   exit 1
33 fi
34 grep "No Jobs running." tmp/fd.out 2>&1 >/dev/null
35 if [ $? != 0 ] ; then
36   echo " "
37   echo "  !!!! Zombie Jobs in File daemon !!!!"
38   echo "  !!!! Zombie Jobs in File daemon !!!!" >>test.out
39   echo " "
40   exit 1
41 fi
42 grep "No Jobs running." tmp/sd.out 2>&1 >/dev/null
43 if [ $? != 0 ] ; then
44   echo " "
45   echo "  !!!! Zombie Jobs in Storage daemon !!!!"
46   echo "  !!!! Zombie Jobs in Storage daemon !!!!" >>test.out
47   echo " "
48   exit 1
49 fi
50 grep "ERROR" tmp/log*.out 2>&1 >/dev/null
51 if [ $? = 0 ] ; then
52   echo " "
53   echo "  !!!! ERROR in log output !!!!"
54   echo "  !!!! ERROR in log output !!!!" >>test.out
55   echo " "
56   exit 1
57 fi
58 grep "Fatal Error" tmp/log*.out 2>&1 >/dev/null
59 if [ $? = 0 ] ; then
60   echo " "
61   echo "  !!!! Fatal Error in log output !!!!"
62   echo "  !!!! Fatal Error in log output !!!!" >>test.out
63   echo " "
64   exit 1
65 fi
66
67 grep "glibc detected" tmp/log*.out 2>&1 >/dev/null
68 if [ $? = 0 ] ; then
69   echo " "
70   echo "  !!!! glibc detected Error in log output !!!!"
71   echo "  !!!! glibc detected Error in log output !!!!" >>test.out
72   echo " "
73   exit 1
74 fi