equal
deleted
inserted
replaced
41 |
41 |
42 #---- |
42 #---- |
43 |
43 |
44 sub main { |
44 sub main { |
45 my @opt_exclude; |
45 my @opt_exclude; |
46 my @opt_include; |
|
47 my $opt_verbose = 0; |
46 my $opt_verbose = 0; |
48 |
47 |
49 GetOptions( |
48 GetOptions( |
50 'e|x|exclude=s@' => \@opt_exclude, |
49 'e|x|exclude=s@' => \@opt_exclude, |
51 'i|include=s@' => \@opt_include, |
|
52 'h|help' => sub { pod2usage(-verbose => 1, -exit => 0) }, |
50 'h|help' => sub { pod2usage(-verbose => 1, -exit => 0) }, |
53 'm|man' => sub { pod2usage(-verbose => 2, -exit => 0) }, |
51 'm|man' => sub { pod2usage(-verbose => 2, -exit => 0) }, |
54 'v|verbose' => \$opt_verbose, |
52 'v|verbose' => \$opt_verbose, |
55 ) or pod2usage; |
53 ) or pod2usage; |
56 |
54 |
78 |
76 |
79 my @dles = eval { |
77 my @dles = eval { |
80 compare_lists |
78 compare_lists |
81 confs => \@confs, |
79 confs => \@confs, |
82 exclude => \@opt_exclude, |
80 exclude => \@opt_exclude, |
83 include => \@opt_include; |
|
84 } |
81 } |
85 or CRITICAL $@; |
82 or CRITICAL $@; |
86 OK 'config: ' . join(', ', @confs), @dles; |
83 OK 'config: ' . join(', ', @confs), @dles; |
87 |
84 |
88 # never reached |
85 # never reached |
219 |
216 |
220 sub compare_lists { |
217 sub compare_lists { |
221 my %arg = @_; |
218 my %arg = @_; |
222 my @confs = @{ $arg{confs} } or croak 'missing list of confs'; |
219 my @confs = @{ $arg{confs} } or croak 'missing list of confs'; |
223 my @exclude = @{ $arg{exclude} }; |
220 my @exclude = @{ $arg{exclude} }; |
224 my @include = @{ $arg{include} }; |
|
225 |
221 |
226 WARNING |
222 WARNING |
227 "excluded filesystem(s) @$_ does not exist, update the config please!\n" |
223 "excluded filesystem(s) @$_ does not exist, update the config please!\n" |
228 if @exclude |
224 if @exclude |
229 and @$_ = grep { not -e } unique map { /^.*?:(.*)/ } @exclude; |
225 and @$_ = grep { not -e } unique map { /^.*?:(.*)/ } @exclude; |
230 |
226 |
231 my @candidates = (get_devices, @include); |
227 my @candidates = get_devices; |
232 my %missing; |
228 my %missing; |
233 |
229 |
234 foreach my $conf (@confs) { |
230 foreach my $conf (@confs) { |
235 my @dles = _amlist $conf; |
231 my @dles = _amlist $conf; |
236 foreach my $candidate (@candidates) { |
232 foreach my $candidate (@candidates) { |
285 No config means all configs. |
281 No config means all configs. |
286 |
282 |
287 check_amanda-client --exclude weekly:/var/spool/squid --exclude /boot |
283 check_amanda-client --exclude weekly:/var/spool/squid --exclude /boot |
288 |
284 |
289 |
285 |
290 =item B<-i>|B<--include> [I<config>:]I<filesystem> |
|
291 |
|
292 Which filesystems/directories we additionally want to check. |
|
293 No config means all configs. |
|
294 |
|
295 check_amanda-client --include weekly:/etc |
|
296 |
|
297 If the directory is contained already in another directory/filesystem, |
|
298 the test is satisfied. |
|
299 |
|
300 =item B<-h>|B<--help> |
286 =item B<-h>|B<--help> |
301 |
287 |
302 Show a short description and help text. |
288 Show a short description and help text. |
303 |
289 |
304 =item B<-m>|B<--man> |
290 =item B<-m>|B<--man> |