Remove arrows

master
Heuzef 5 years ago
parent ebadda7d4e
commit eb8c699fb3
  1. 28
      Check.pm

@ -29,16 +29,16 @@ sub action
my($str, $strGood, $header); my($str, $strGood, $header);
GetStatusInfo("hosts info"); GetStatusInfo("hosts info");
my $Privileged = CheckPermission(); my $Privileged = CheckPermission();
my $bpc = BackupPC::Lib->new(); my $bpc = BackupPC::Libnew();
# Start loop # Start loop
foreach my $host ( GetUserHosts(1) ) { foreach my $host ( GetUserHosts(1) ) {
my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor); my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor);
my($shortErr); my($shortErr);
my @Backups = $bpc->BackupInfoRead($host); my @Backups = $bpcBackupInfoRead($host);
$bpc->ConfigRead($host); $bpcConfigRead($host);
%Conf = $bpc->Conf(); %Conf = $bpcConf();
next if ( $Conf{XferMethod} eq "archive" ); next if ( $Conf{XferMethod} eq "archive" );
next if ( !$Privileged && !CheckPermission($host) ); next if ( !$Privileged && !CheckPermission($host) );
@ -51,8 +51,8 @@ sub action
} }
# Age # Age
my $lastBackup = ( $Backups[-1]->{type} =~ m/^full|incr$/ ) ? -1 : -2; my $lastBackup = ( $Backups[-1]{type} =~ m/^full|incr$/ ) ? -1 : -2;
$lastAge = sprintf("%.1f", (time - $Backups[$lastBackup]->{startTime}) / (24 * 3600)); $lastAge = sprintf("%.1f", (time - $Backups[$lastBackup]{startTime}) / (24 * 3600));
# Color for age # Color for age
if ( $lastAge < $frequency ) { if ( $lastAge < $frequency ) {
@ -88,18 +88,18 @@ sub action
if ( scalar( @Backups ) ){ if ( scalar( @Backups ) ){
foreach my $backup ( @Backups ) { foreach my $backup ( @Backups ) {
# Skip partial or active 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 # 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 # 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) # 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; my $i = ( $Backups[-1]{type} =~ m/^full|incr$/ ) ? -1 : -2;
$new_size = $Backups[$i]->{sizeNew}; $new_size = $Backups[$i]{sizeNew};
$new_size_avg = int $sizes->mean; $new_size_avg = int $sizesmean;
$new_size_q1 = eval { int $sizes->quantile(1) } || 0; $new_size_q1 = eval { int $sizesquantile(1) } || 0;
$new_size_q3 = eval { int $sizes->quantile(3) } || 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 # 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 ) { if ( $new_size > ($new_size_q3 + $new_size_q3 - $new_size_q1) * 1.5 or $new_size > $new_size_avg * 6 ) {
$toobig = 1; $toobig = 1;
} }
# TOO SMALL ? If the size is 3 times lower than usual : # TOO SMALL ? If the size is 3 times lower than usual :
my $toosmall = 0; my $toosmall = 0;
if ( $new_size < ($new_size_q1 - $new_size_q3 - $new_size_q1) * 1.5 or $new_size < $new_size_avg / 3 ) { if ( $new_size < ($new_size_q1 - $new_size_q3 - $new_size_q1) * 1.5 or $new_size < $new_size_avg / 3 ) {

Loading…
Cancel
Save