X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=server-src%2Famoverview.pl.in;h=a6f7bf6793220dfa4acf2eb3161e7973acf75056;hb=d3b2175e084f88c8736ad7073eacbf4670147aec;hp=300f7ddd1c2e1ad3790ad890a0f0c7af51b088ff;hpb=1194fb66aa28d9929c3f2bef3cc6c1c3f40a60a4;p=debian%2Famanda diff --git a/server-src/amoverview.pl.in b/server-src/amoverview.pl.in index 300f7dd..a6f7bf6 100644 --- a/server-src/amoverview.pl.in +++ b/server-src/amoverview.pl.in @@ -9,9 +9,13 @@ require 5.001; use FileHandle; use Getopt::Long; +use Text::ParseWords; use Carp; use POSIX; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; +$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; + sub Usage { print STDERR <) { - ($host, $disk) = m/ host (.*?):.* disk (.*?):/s; + ($host, $disk) = m/ host (.*?):.* disk (.*?):.*strategy (STANDARD|NOFULL|NOINC|HANOI|INCRONLY).*ignore NO/s; next unless $host; $disks{$host}{$disk}++; } @@ -124,16 +128,31 @@ while (<$fh>) { next if /found Amanda directory/; next if /skipping cruft directory/; next if /skip-incr/; - ($date, $host, $disk, $level, $tape, $file, $part, $status) = split ' ', $_; + + ($date, $time, $host, $disk, $level, $tape, $file, $part, $status) = shellwords($_); + next if $date eq 'date'; next if $date eq 'Warning:'; next if $date eq 'Scanning'; next if $date eq ""; + + if($time !~/^\d\d:\d\d:\d\d$/) { + $status = $part; + $part = $file; + $file = $tape; + $tape = $level; + $level = $disk; + $disk = $host; + $host = $time; + } + if ($date =~ /^\d\d\d\d-\d\d-\d\d$/) { - defined($level{$host}{$disk}{$date}) or - $level{$host}{$disk}{$date} = ''; - $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E'; - $dates{$date}++; + if(defined $disks{$host}{$disk}) { + defined($level{$host}{$disk}{$date}) or + $level{$host}{$disk}{$date} = ''; + $level{$host}{$disk}{$date} .= ($status eq 'OK') ? $level : 'E'; + $dates{$date}++; + } } else { print "bad date $date in $_\n";