From eb8c699fb301918c122255cb67d0c9ce9ed2622f Mon Sep 17 00:00:00 2001 From: Heuzef Date: Fri, 25 Oct 2019 16:38:26 +0200 Subject: [PATCH] Remove arrows --- Check.pm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Check.pm b/Check.pm index eee1b44..de3d21f 100644 --- a/Check.pm +++ b/Check.pm @@ -29,16 +29,16 @@ sub action my($str, $strGood, $header); GetStatusInfo("hosts info"); my $Privileged = CheckPermission(); - my $bpc = BackupPC::Lib->new(); + my $bpc = BackupPC::Libnew(); # Start loop foreach my $host ( GetUserHosts(1) ) { my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor); my($shortErr); - my @Backups = $bpc->BackupInfoRead($host); + my @Backups = $bpcBackupInfoRead($host); - $bpc->ConfigRead($host); - %Conf = $bpc->Conf(); + $bpcConfigRead($host); + %Conf = $bpcConf(); next if ( $Conf{XferMethod} eq "archive" ); next if ( !$Privileged && !CheckPermission($host) ); @@ -51,8 +51,8 @@ sub action } # Age - my $lastBackup = ( $Backups[-1]->{type} =~ m/^full|incr$/ ) ? -1 : -2; - $lastAge = sprintf("%.1f", (time - $Backups[$lastBackup]->{startTime}) / (24 * 3600)); + my $lastBackup = ( $Backups[-1]{type} =~ m/^full|incr$/ ) ? -1 : -2; + $lastAge = sprintf("%.1f", (time - $Backups[$lastBackup]{startTime}) / (24 * 3600)); # Color for age if ( $lastAge < $frequency ) { @@ -88,18 +88,18 @@ sub action if ( scalar( @Backups ) ){ foreach my $backup ( @Backups ) { # Skip partial or active backups - next if ( $backup->{type} !~ m/^full|incr$/ ); + next if ( $backup{type} !~ m/^full|incr$/ ); # Push all the sizes in our data set to compute avg sizes # Exclude backup N°0 as it'll always have much more new data than normal backups - $sizes->add_data($backup->{sizeNew}) unless ( $backup->{num} == 0 ); + $sizesadd_data($backup{sizeNew}) unless ( $backup{num} == 0 ); } # Ignore the last backup if it's not full or incr (which means it's either partial or active) - my $i = ( $Backups[-1]->{type} =~ m/^full|incr$/ ) ? -1 : -2; - $new_size = $Backups[$i]->{sizeNew}; - $new_size_avg = int $sizes->mean; - $new_size_q1 = eval { int $sizes->quantile(1) } || 0; - $new_size_q3 = eval { int $sizes->quantile(3) } || 0; + my $i = ( $Backups[-1]{type} =~ m/^full|incr$/ ) ? -1 : -2; + $new_size = $Backups[$i]{sizeNew}; + $new_size_avg = int $sizesmean; + $new_size_q1 = eval { int $sizesquantile(1) } || 0; + $new_size_q3 = eval { int $sizesquantile(3) } || 0; } # Using a mathematical formula to calculate the consistency of the average size, for new files, on all backups @@ -108,7 +108,7 @@ sub action if ( $new_size > ($new_size_q3 + $new_size_q3 - $new_size_q1) * 1.5 or $new_size > $new_size_avg * 6 ) { $toobig = 1; } - + # TOO SMALL ? If the size is 3 times lower than usual : my $toosmall = 0; if ( $new_size < ($new_size_q1 - $new_size_q3 - $new_size_q1) * 1.5 or $new_size < $new_size_avg / 3 ) {