Don't count vm as an entity in BackupPC's entities discovery

tags/zabbix-agent-addons-0.2.69-1
Daniel Berteaud 6 years ago
parent ce3946344f
commit e51f0065a0
  1. 10
      zabbix_scripts/disco_backuppc_sudo

@ -31,20 +31,20 @@ my $json;
if ($entities) {
my %entities = ();
foreach my $host (keys %$hosts){
if ($host =~ m/^(?:vm_)?([^_]+)_.*/) {
foreach my $host ( keys %$hosts ){
if ( $host =~ m/^(?:vm_)?([^_]+)_.*/ and $1 ne 'vm' ) {
$entities{$1}= 1;
}
}
push @{$json->{data}}, { '{#BPC_ENTITY}' => $_ } foreach ( keys %entities );
} elsif ($hosts){
foreach my $host (keys %$hosts){
foreach my $host ( keys %$hosts ){
my $hostConf = $bpc->ConfigDataRead($host);
my $conf = { %$mainConf, %$hostConf };
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 $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}},
{
"{#BPCHOST}" => $host,

Loading…
Cancel
Save