Only substract $new_size_of_last_full once

tags/zabbix-agent-addons-0.2.100-1
Daniel Berteaud před 4 roky
rodič 345cc4d6f3
revize eb0ada1a69
  1. 6
      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;

Načítá se…
Zrušit
Uložit