plugins/check_amanda-client
changeset 66 3592ab3a8ce7
parent 63 4a943f659c99
equal deleted inserted replaced
65:4bdda1d2bd88 66:3592ab3a8ce7
    11 use File::Find;
    11 use File::Find;
    12 use Carp;
    12 use Carp;
    13 use Pod::Usage;
    13 use Pod::Usage;
    14 use Const::Fast;
    14 use Const::Fast;
    15 use if $ENV{DEBUG} => 'Smart::Comments';
    15 use if $ENV{DEBUG} => 'Smart::Comments';
    16 use if $^V >= v5.18 => (experimental => qw/smartmatch lexical_topic/);
    16 use if $^V >= v5.18 => (experimental => qw/smartmatch/);
    17 
    17 
    18 const my $NAME  => 'AMANDA-CLIENT';
    18 const my $NAME  => 'AMANDA-CLIENT';
    19 const my $USER  => 'backup';
    19 const my $USER  => 'backup';
    20 const my $CFDIR => '/etc/amanda';
    20 const my $CFDIR => '/etc/amanda';
    21 
    21 
   199     #
   199     #
   200     #(brought to you by Amanda 3.3.1)
   200     #(brought to you by Amanda 3.3.1)
   201     #The check is finished
   201     #The check is finished
   202 
   202 
   203     my $conf = shift;
   203     my $conf = shift;
   204     my $_    = qx(amdump_client --config '$conf' check 2>&1);
   204     my $o    = qx(amdump_client --config '$conf' check 2>&1);
   205 
   205 
   206     /^config:\s+
   206     $o =~ /^config:\s+
   207       (BUSY Amanda is busy, retry later)/smx
   207       (BUSY Amanda is busy, retry later)/smx
   208       and WARNING "$1\n";
   208       and WARNING "$1\n";
   209 
   209 
   210     /^config:\s+$conf\n
   210     $o =~ /^config:\s+$conf\n
   211 		 CHECKING\n
   211 		 CHECKING\n
   212 		 .*\n
   212 		 .*\n
   213 		 Client.check:.1.host.checked.in.\d+\.\d+.seconds\.\s+0.problems.found\.\n
   213 		 Client.check:.1.host.checked.in.\d+\.\d+.seconds\.\s+0.problems.found\.\n
   214 		 .*\n
   214 		 .*\n
   215 		 The.check.is.finished$
   215 		 The.check.is.finished$
   216 	/smx or UNKNOWN "unexpected output from check:\n$_";
   216 	/smx or UNKNOWN "unexpected output from check:\n$o";
   217 }
   217 }
   218 
   218 
   219 sub amchecks {
   219 sub amchecks {
   220     my @errors = ();
   220     my @errors = ();
   221     foreach my $conf (@_) {
   221     foreach my $conf (@_) {