ADSM-L

Re: How to tell tape lifespan

2000-02-01 17:34:53
Subject: Re: How to tell tape lifespan
From: Russell Street <russells AT AUCKLAND.AC DOT NZ>
Date: Wed, 2 Feb 2000 11:34:53 +1300
> q vol * f=d will tell you how many mounts each volume has
> undergone, but only since it has been put into a storage pool, right?

Correct.



Being a control freak, I keep offline copies of the ADSM activity log
forever.

I created a script (below) that will extract this information from the
saved activity logs and tell you the utilisation on each drive and how
many times the tape has been mounted.

Perhaps the best thing to do is to
 - start keeping records from "today"
 - salvage any tapes that give read or write errors and then discard them
 - salvage and discard any tapes that reach the threshold

Or just bite the bullet and replace all the existing tapes.


Russell
============================================================
#!/usr/local/bin/perl5 -w
#!/usr/local/bin/perl5 -w

use strict;
use Data::Dumper;
use Statistics::Descriptive;

## mount-count --- count the number of times DLT tapes have been
## mounted and unmounted

my %tape_count = ();
my %mounts = ();
my %total_count = ();

while(<>) {
    ## Ignore anything but mount (ANR8337I) and dismount (ANR8468I) messages
    ## Extract the pieces we want as well...
    next if !/^(.*)(ANR8337I|ANR8468I).*DLT volume (\S+).*drive (\S+)/;

    my ($time, $action, $volume, $drive) = ($1, $2, $3, $4);

    my $xtime = $time;
    $xtime =~ s/:\d+:\d+\s+/:00:00/; ## Consolodate into days
    # ($xtime) = ($xtime =~ / (\d+):/);

    $mounts{$drive}->{$xtime}++ if $action eq 'ANR8337I';
    $total_count{$drive}++ if $action eq 'ANR8337I';
    $tape_count{$volume}++;
}

## print Dumper(\%mounts);

## Now work out the average et al tape mounts per hour

## Headings...

printf("Drive   Time   ");
foreach (1..13) {
    printf "%6d", $_;
}
printf "  avg ";
print "\n";

print "=" x 100, "\n";


foreach my $drive (keys %mounts) {
    my @stats = ();
    foreach (0..23) {
        $stats[$_] = Statistics::Descriptive::Full->new();
    }

    my @f = ();
    foreach my $k (keys %{$mounts{$drive}}) {
        my ($hour) = ($k =~ / (\d\d):/);
        $stats[$hour]->add_data($mounts{$drive}->{$k});

        $f[$hour]->[$mounts{$drive}->{$k}]++;
    }

    foreach my $s (0..23) {
        #printf("$drive %02d:00 %0.1f +/- %0.1f  max %d\n",
        #$s,
        #$stats[$s]->mean(),
        #$stats[$s]->standard_deviation(),
        #$stats[$s]->max(),
        #);

        printf("$drive %02d:00  ",
               $s,
               );

        $stats[$s]->sort_data;
        # my %f = 
$stats[$s]->frequency_distribution($stats[$s]->max()-$stats[$s]->min);
        foreach (1..13) {
            printf "%6d", $f[$s]->[$_]  if  defined $f[$s]->[$_] && 
$f[$s]->[$_] != 0;
            printf "%6s", ""      if !defined $f[$s]->[$_] || $f[$s]->[$_] == 0;

            #printf "%6d", $f{$_} if  defined $f{$_};
            #printf "%6s", ""     if !defined $f{$_};
        }

        printf "  avg %.1f", $stats[$s]->mean();


        print "\n";

    }

    print "\n\n";

}

foreach my $drive (keys %total_count) {
    print "Total mounts $drive $total_count{$drive}\n";
}

print "=" x 100, "\n";

foreach (sort {$tape_count{$b} <=> $tape_count{$a}}  keys %tape_count) {
    print "$_  $tape_count{$_}\n";
}
<Prev in Thread] Current Thread [Next in Thread>