Return No backup warning and max errors threshold in backuppc discovery

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 12 years ago
parent a734699fc9
commit 974b41a11a
  1. 6
      zabbix_scripts/disco_backuppc_sudo

@ -36,12 +36,14 @@ foreach my $host (keys %$hosts){
next unless ($host =~ m!$regex!); next unless ($host =~ m!$regex!);
my $hostConf = $bpc->ConfigDataRead($host); my $hostConf = $bpc->ConfigDataRead($host);
my $conf = { %$mainConf, %$hostConf }; my $conf = { %$mainConf, %$hostConf };
my $period = ($conf->{FullPeriod} >= $conf->{IncrPeriod}) ? $conf->{IncrPeriod} : $conf->{FullPeriod}; my $warning = $conf->{EMailNotifyOldBackupDays};
my $errors = (defined $conf->{MaxXferError}) ? $conf->{MaxXferError}: '0';
my $status = ($conf->{BackupsDisable} eq 1) ? 'disabled':'enabled'; my $status = ($conf->{BackupsDisable} eq 1) ? 'disabled':'enabled';
push @{$json->{data}}, push @{$json->{data}},
{ {
"{#BPCHOST}" => $host, "{#BPCHOST}" => $host,
"{#BPCPERIOD}" => $period, "{#BPCNOBACKUPWARNING}" => $warning,
"{#BPCMAXERROR}" => $errors,
"{#BPCSTATUS}" => $status, "{#BPCSTATUS}" => $status,
}; };
} }

Loading…
Cancel
Save