[BACK]Return to check_rrd CVS log [TXT][DIR] Up to [local] / nagios / check_rrd / bin

Diff for /nagios/check_rrd/bin/check_rrd between version 1.11 and 1.12

version 1.11, 2008/05/24 14:13:15 version 1.12, 2008/05/24 22:34:05
Line 1 
Line 1 
 #!/usr/bin/perl -T  #!/usr/bin/perl -T
 # $RedRiver: check_rrd,v 1.10 2008/05/24 01:03:23 andrew Exp $  # $RedRiver: check_rrd,v 1.11 2008/05/24 13:13:15 andrew Exp $
 ########################################################################  ########################################################################
 # check_rrd *** A nagios check for changing averages in rrds  # check_rrd *** A nagios check for changing averages in rrds
 #  #
Line 149 
Line 149 
         '-e', $end          '-e', $end
 ) or die "Problem fetching from '$filename': $!";  ) or die "Problem fetching from '$filename': $!";
   
   #print Dumper $data;
   #print Dumper \%TIMES;
   
 my %totals;  my %totals;
 foreach my $line (@$data) {  foreach my $line (@$data) {
         foreach my $i (0 .. $#{ $line }) {          foreach my $i (0 .. $#{ $line }) {
                 next unless defined $line->[$i];                  next unless defined $line->[$i];
                 foreach my $key (keys %TIMES) {                  foreach my $time (keys %TIMES) {
                         if ($end - $TIMES{$key} < $start) {                          #print "[$end] - [$start] = [" . ($end - $start) . "] <= [$TIMES{$time}]\n";
                           if (($end - $start) <= $TIMES{$time}) {
                                 foreach ('max', 'min') {                                  foreach ('max', 'min') {
                                         $totals{ $names->[$i] }{$key}{$_} = $line->[$i]                                          $totals{ $names->[$i] }{$time}{$_} = $line->[$i]
                                                 unless defined $totals{ $names->[$i] }{$key}{$_};                                                  unless defined $totals{ $names->[$i] }{$time}{$_};
                                 }                                  }
                                 no warnings q/uninitialized/;                                  no warnings q/uninitialized/;
                                 $totals{ $names->[$i] }{$key}{'count'}++;                                  $totals{ $names->[$i] }{$time}{'count'}++;
                                 $totals{ $names->[$i] }{$key}{'total'} += $line->[$i];                                  $totals{ $names->[$i] }{$time}{'total'} += $line->[$i];
                                 $totals{ $names->[$i] }{$key}{'max'} = $line->[$i]                                  $totals{ $names->[$i] }{$time}{'max'} = $line->[$i]
                                         if $totals{ $names->[$i] }{$key}{'max'} < $line->[$i];                                          if $totals{ $names->[$i] }{$time}{'max'} < $line->[$i];
                                 $totals{ $names->[$i] }{$key}{'min'} = $line->[$i]                                  $totals{ $names->[$i] }{$time}{'min'} = $line->[$i]
                                         if $totals{ $names->[$i] }{$key}{'min'} > $line->[$i];                                          if $totals{ $names->[$i] }{$time}{'min'} > $line->[$i];
                         }                          }
                 }                  }
         }          }
Line 180 
Line 184 
                   if $totals{$key}{$length}{'count'};                    if $totals{$key}{$length}{'count'};
         }          }
 }  }
   
   #print Dumper \%totals;
   
 my %check_status;  my %check_status;
 foreach my $key (keys %totals) {  foreach my $key (keys %totals) {

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>