Fix reporting MaxXferError

tags/zabbix-agent-addons-0.2.72-1
Daniel Berteaud 6 years ago
parent 9668c8eff2
commit 5e01f9ee2d
  1. 3
      zabbix_scripts/check_backuppc_sudo
  2. 2
      zabbix_scripts/disco_backuppc_sudo

@ -60,7 +60,8 @@ if ( $host ) {
$json->{total_size} += $json->{full_size} - 2 * $new_size_of_last_full; $json->{total_size} += $json->{full_size} - 2 * $new_size_of_last_full;
$json->{age} = time - $age; $json->{age} = time - $age;
$json->{max_errors} = $conf->{MaxXferError} if (defined $conf->{MaxXferError}); $json->{max_errors} = $conf->{MaxXferError} || 0;
} elsif ( $entity ) { } elsif ( $entity ) {
$json = { $json = {

@ -42,7 +42,7 @@ if ($entities) {
my $hostConf = $bpc->ConfigDataRead($host); my $hostConf = $bpc->ConfigDataRead($host);
my $conf = { %$mainConf, %$hostConf }; my $conf = { %$mainConf, %$hostConf };
my $warning = $conf->{EMailNotifyOldBackupDays}; my $warning = $conf->{EMailNotifyOldBackupDays};
my $errors = ( defined $conf->{MaxXferError} ) ? $conf->{MaxXferError}: '0'; my $errors = ( defined $conf->{MaxXferError} ) ? $conf->{MaxXferError} : '0';
my $monitoring = $conf->{ZabbixMonitoring} || 1; my $monitoring = $conf->{ZabbixMonitoring} || 1;
my $status = ( $conf->{BackupsDisable} gt 0 or $monitoring eq '0' ) ? '0' : '1'; my $status = ( $conf->{BackupsDisable} gt 0 or $monitoring eq '0' ) ? '0' : '1';
push @{$json->{data}}, push @{$json->{data}},

Loading…
Cancel
Save