From ac5c4eee3de6797ece0fadc5be69f16d1efb3c8c Mon Sep 17 00:00:00 2001 From: Heuzef Date: Thu, 31 Oct 2019 12:03:25 +0100 Subject: [PATCH] Remove not enought backup function ... --- Check.pm | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Check.pm b/Check.pm index 055e531..55bcbed 100644 --- a/Check.pm +++ b/Check.pm @@ -105,33 +105,26 @@ sub action # Using a mathematical formula to calculate the consistency of the average size, for new files, on all backups my $toobig = 0; my $toosmall = 0; + my $sizeConsistencyColor = "Tomato"; + my $sizeConsistency = "ANOMALOUS"; - # There are enough backup ? - if ( $idBackup < 4 ) { - my $sizeConsistencyColor = "Gray"; - my $sizeConsistency = "Not enough backups"; - } else { + # TOO BIG ? If the size is 6 times higher than usual : + if ( $new_size > ($new_size_q3 + ($new_size_q3 - $new_size_q1) ) * 1.5 and $new_size > $new_size_avg * 6 ) { + $toobig = 1; + } - # TOO BIG ? If the size is 6 times higher than usual : - if ( $new_size > ($new_size_q3 + ($new_size_q3 - $new_size_q1) ) * 1.5 and $new_size > $new_size_avg * 6 ) { - $toobig = 1; - } - - # TOO SMALL ? If the size is 3 times lower than usual : - if ( $new_size < ($new_size_q1 - ($new_size_q3 - $new_size_q1) ) * 1.5 and $new_size < $new_size_avg / 3 ) { - $toosmall = 1; - } - - # Get result - if ( not $toobig and not $toosmall ) { - $sizeConsistencyColor = "MediumSeaGreen"; - $sizeConsistency = "Normal"; - } else { - my $sizeConsistencyColor = "Tomato"; - my $sizeConsistency = "ANOMALOUS"; - } + # TOO SMALL ? If the size is 3 times lower than usual : + if ( $new_size < ($new_size_q1 - ($new_size_q3 - $new_size_q1) ) * 1.5 and $new_size < $new_size_avg / 3 ) { + $toosmall = 1; } + # Get result + if ( not $toobig and not $toosmall ) { + $sizeConsistencyColor = "MediumSeaGreen"; + $sizeConsistency = "Normal"; + } + + # Get URL for explore file my $browseFile = "?action=browse&host=$host";