Networker

Re: [Networker] list of clients with unsuccessful backup

2009-02-02 09:56:55
Subject: Re: [Networker] list of clients with unsuccessful backup
From: Yaron Zabary <yaron AT ARISTO.TAU.AC DOT IL>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Mon, 2 Feb 2009 16:54:54 +0200
JW wrote:
Hi.

How can you generate a list of networker clients which have unsuccesful
backups the laset 24hours, last week etc ?  That is only a list of
unsuccessful jobs without information about the successful ones.

Is that possible with mminfo ?

I am attaching a perl script which I use to report savesets which do not have a full backup in the last 35 days.


JW

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER


--

-- Yaron.

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

#!/usr/bin/perl


open(EXCLUDE,"</usr/local/TAUSRC/Local/dailyreport/excludelist");

while(<EXCLUDE>)
{
  chomp;
  push(@exclude,$_);  
}

open(MMINFO,"mminfo -a -xc, -r client,name,nsavetime,level |");

$header = <MMINFO>;

while ($line = <MMINFO>)
{
  chop($line);
  ($client,$ssname,$time,$level) = split(/,/,$line);
  $ssname =~ s/\\//;
  $ss = $client.':'.$ssname;
  $count{$ss}++;
  $sstimeo{$ss} = max($sstimeo{$ss},$time);
  next unless $level eq 'full';
  $countf{$ss}++;
  $sstime{$ss} = max($sstime{$ss},$time);
  #if ($sstime{$ss} == undef)
  #{
    #$sstime{$ss} = $time;
    #next;
  #}
  #if ($sstime{$ss} < $time)
  #{
    #$sstime{$ss} = $time;
  #}
}

$monthago = time() - 35*24*60*60;
foreach $ssx (sort keys %sstime)
{
  if ($sstime{$ssx} <= $monthago)
  {
    #($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
localtime($sstime{$ssx});
    @l = grep { $ssx =~ /$_/ } @exclude;
    #print "$ssx $countf{$ssx}/$count{$ss} $mday/",$mon+1,"/",1900+$year,"\n" 
unless $#l >= 0;
    print "$ssx $countf{$ssx}/$count{$ss} ".datex($sstime{$ssx})." 
".datex($sstimeo{$ssx})."\n" unless $#l >= 0;
  }
}

sub max

{
  my($a) = @_; shift;
  my($b) = @_; 
  return $b if ($a == undef);
  return $a if ($b == undef);
  return ($a > $b)?$a:$b;
}

sub datex
{
  my($t) = @_;
  ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($t);
  my $y = 1900 + $year;
  my $m = $mon + 1;
  return $mday."/".$m."/".$y;
}

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER