Changeset 13579 for trunk/DataCheck


Ignore:
Timestamp:
05/07/12 10:39:53 (13 years ago)
Author:
Daniela Dorner
Message:
added check for empty return of mysql
File:
1 edited

Legend:

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

    r13094 r13579  
    3636   query="SELECT Count(*) FROM "$step"Status "$where
    3737   num=`sendquery`
    38    if [ $num -gt 0 ]
    39    then
    40       printprocesslog "WARN found in "$step" "$num" rows with errors."
    41       sel=$selstart", '(', fReturnCode, ')')"
    42       query="SELECT "$sel" FROM "$step"Status "$where
    43       sendquery | mail -s 'found failed jobs in '$step $erradrs
    44       printprocesslog "INFO sent mail about failed jobs in "$step" to "$erradrs
     38   if [ "$num" == "" ]
     39   then
     40      printprocesslog "WARN could not get number of failed jobs from the DB."
     41   else
     42      if [ $num -gt 0 ]
     43      then
     44         printprocesslog "WARN found in "$step" "$num" rows with errors."
     45         sel=$selstart", '(', fReturnCode, ')')"
     46         query="SELECT "$sel" FROM "$step"Status "$where
     47         sendquery | mail -s 'found failed jobs in '$step $erradrs
     48         printprocesslog "INFO sent mail about failed jobs in "$step" to "$erradrs
     49      fi
    4550   fi
    4651
     
    5459   query="SELECT Count(*) FROM "$step"Status "$where
    5560   num=`sendquery`
    56    if [ $num -gt 0 ]
    57    then
    58       printprocesslog "WARN found in "$step" "$num" crashed jobs."
    59       sel=$selstart", '(', fStartTime, ')')"
    60       query="SELECT "$sel" FROM "$step"Status "$where
    61       sendquery | mail -s 'found crashed jobs in '$step $erradrs
    62       printprocesslog "INFO sent mail about crashed jobs in "$step" to "$erradrs
     61   if [ "$num" == "" ]
     62   then
     63      printprocesslog "WARN could not get number of crashed jobs from the DB."
     64   else
     65      if [ $num -gt 0 ]
     66      then
     67         printprocesslog "WARN found in "$step" "$num" crashed jobs."
     68         sel=$selstart", '(', fStartTime, ')')"
     69         query="SELECT "$sel" FROM "$step"Status "$where
     70         sendquery | mail -s 'found crashed jobs in '$step $erradrs
     71         printprocesslog "INFO sent mail about crashed jobs in "$step" to "$erradrs
     72      fi
    6373   fi
    6474done
Note: See TracChangeset for help on using the changeset viewer.