plugins/check_amanda-client
changeset 28 55ace296247b
parent 23 6c2728f0c6f7
child 40 d0410b54a231
equal deleted inserted replaced
27:4f11b6ecea2c 28:55ace296247b
    72     my @confs = sort +unique eval { config_names $CFDIR }
    72     my @confs = sort +unique eval { config_names $CFDIR }
    73       or UNKNOWN $@;
    73       or UNKNOWN $@;
    74 
    74 
    75     eval { amchecks @confs } or CRITICAL $@;
    75     eval { amchecks @confs } or CRITICAL $@;
    76 
    76 
    77     my @dles = eval {
    77     my @dles =
    78         compare_lists
    78       eval { compare_lists confs => \@confs, exclude => \@opt_exclude, }
    79           confs   => \@confs,
       
    80           exclude => \@opt_exclude,
       
    81     }
       
    82       or CRITICAL $@;
    79       or CRITICAL $@;
    83     OK 'config: ' . join(', ', @confs), @dles;
    80     OK 'config: ' . join(', ', @confs), @dles;
    84 
    81 
    85     # never reached
    82     # never reached
    86     return 0;
    83     return 0;
   181     #(brought to you by Amanda 3.3.1)
   178     #(brought to you by Amanda 3.3.1)
   182     #The check is finished
   179     #The check is finished
   183 
   180 
   184     my $conf = shift;
   181     my $conf = shift;
   185     my $_    = qx(amdump_client --config '$conf' check 2>&1);
   182     my $_    = qx(amdump_client --config '$conf' check 2>&1);
       
   183 
       
   184     /^config:\s+
       
   185       (BUSY Amanda is busy, retry later)/smx
       
   186       and WARNING "$1\n";
       
   187 
   186     /^config:\s+$conf\n
   188     /^config:\s+$conf\n
   187 		 CHECKING\n
   189 		 CHECKING\n
   188 		 .*\n
   190 		 .*\n
   189 		 Client.check:.1.host.checked.in.\d+\.\d+.seconds\.\s+0.problems.found\.\n
   191 		 Client.check:.1.host.checked.in.\d+\.\d+.seconds\.\s+0.problems.found\.\n
   190 		 .*\n
   192 		 .*\n
   191 		 The.check.is.finished$
   193 		 The.check.is.finished$
   192 	/smx or die "unexpected output from check:\n$_";
   194 	/smx or UNKNOWN "unexpected output from check:\n$_";
   193 }
   195 }
   194 
   196 
   195 sub amchecks {
   197 sub amchecks {
   196     my @errors = ();
   198     my @errors = ();
   197     foreach my $conf (@_) {
   199     foreach my $conf (@_) {