From eb0ada1a690cc69bd9819a7213a569c573e200a4 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 15 Dec 2019 16:59:26 +0100 Subject: [PATCH] Only substract $new_size_of_last_full once --- zabbix_scripts/check_backuppc_sudo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zabbix_scripts/check_backuppc_sudo b/zabbix_scripts/check_backuppc_sudo index f583704..2a4ec3e 100644 --- a/zabbix_scripts/check_backuppc_sudo +++ b/zabbix_scripts/check_backuppc_sudo @@ -83,7 +83,7 @@ if ( $host ) { $json->{new_size_q1} = eval { int $sizes->quantile(1) } || 0; $json->{new_size_q3} = eval { int $sizes->quantile(3) } || 0; $json->{enabled} = ( $conf->{BackupsDisable} > 0 ) ? 0 : 1; - $json->{total_size} = $sizes->sum + $json->{full_size} - 2 * $new_size_of_last_full; + $json->{total_size} = $sizes->sum + $json->{full_size} - $new_size_of_last_full; $json->{history_size} = $json->{total_size} - $json->{full_size}; $json->{age} = time - $bpc_info[$i]->{startTime}; @@ -149,8 +149,8 @@ if ( $host ) { # $json->{size} represents the total size used by this host. # But we want to substract the new size of the last full, as for this one we - # do not count sizeNew but size. As we've already added sizeNew we need to substract it 2 times - my $host_total_size = $host_new_size + $host_full_size - 2 * $host_new_size_of_last_full; + # do not count sizeNew but size + my $host_total_size = $host_new_size + $host_full_size - $host_new_size_of_last_full; # This one is kept just for compatibility. New Zabbix template will use total_size $json->{size} += $host_total_size;