From 474c6831ad433e2a1c6df9cc190a254d4fa0f5c5 Mon Sep 17 00:00:00 2001 From: Heuzef Date: Fri, 11 Oct 2019 17:27:08 +0200 Subject: [PATCH] Clean useless fonction for age --- Check.pm | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/Check.pm b/Check.pm index 326a320..965975b 100644 --- a/Check.pm +++ b/Check.pm @@ -36,7 +36,6 @@ sub action my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor); my($shortErr); my @Backups = $bpc->BackupInfoRead($host); - my $fullAge = $incrAge = $lastAge = -1; $bpc->ConfigRead($host); %Conf = $bpc->Conf(); @@ -52,10 +51,8 @@ sub action } # Age - for ( my $i = 0 ; $i < @Backups ; $i++ ) { - if ( $Backups[$i]{type} eq "full" or "incr" ) { - $lastAge = sprintf("%.1f", (time - $Backups[-1]{startTime}) / (24 * 3600)); - } + if ( $Backups[$i]{type} eq "full" or "incr" ) { + $lastAge = sprintf("%.1f", (time - $Backups[-1]{startTime}) / (24 * 3600)); } # Color for age @@ -64,17 +61,7 @@ sub action } else { $lastAgeColor = "Tomato"; } - if ( $fullAge < 0 ) { - $fullAge = 0; - } else { - $fullAge = sprintf("%.1f", (time - $fullAge) / (24 * 3600)); - } - if ( $incrAge < 0 ) { - $incrAge = 0; - } else { - $incrAge = sprintf("%.1f", (time - $incrAge) / (24 * 3600)); - } - $incrAge = " " if ( $incrAge eq "" ); + # Color for errors $lastXferErrors = $Backups[@Backups-1]{xferErrs} if ( @Backups ); if ( $lastXferErrors == 0 ) {