From 4e0b935405d7d42d5c7f74a76de424c8b0b31c17 Mon Sep 17 00:00:00 2001 From: heuzef Date: Mon, 22 Feb 2021 16:13:28 +0100 Subject: [PATCH] Ajust function for get total of backups (incr + full) --- Check.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Check.pm b/Check.pm index 4372c47..45510c1 100644 --- a/Check.pm +++ b/Check.pm @@ -36,10 +36,10 @@ sub action # Start loop foreach my $host ( GetUserHosts(1) ) { - my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor, $ifErrors, $sizeConsistency, $sizeConsistencyColor); + my($incrAge, $reasonHilite, $frequency, $lastAge, $lastAgeColor, $tempState, $tempReason, $lastXferErrors, $lastXferErrorsColor, $ifErrors, $sizeConsistency, $sizeConsistencyColor, $fullCnt, $incrCnt, $nbBackups); my($shortErr); my @Backups = $bpc->BackupInfoRead($host); - my $fullCnt = $incrCnt = 0; + $fullCnt = $incrCnt = $nbBackup = 0; $bpc->ConfigRead($host); %Conf = $bpc->Conf(); @@ -50,9 +50,9 @@ sub action # Get number of total backups for ( my $i = 0 ; $i < @Backups ; $i++ ) { if ( $Backups[$i]{type} eq "full" ) { $fullCnt++; } - } elsif ( $Backups[$i]{type} eq "incr" ) { $incrCnt++; } + elsif ( $Backups[$i]{type} eq "incr" ) { $incrCnt++; } } - my $nbBackup = $fullCnt + $incrCnt; + $nbBackups = $fullCnt + $incrCnt; # Get frequency for this host if ( $Conf{IncrPeriod} < $Conf{FullPeriod} ) {