From 4ec0b5677d6518367c817272f16964afd279f91c Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Wed, 14 Aug 2019 10:34:52 +0200 Subject: [PATCH] handle esx without cluster --- connectors/vmware/src/centreon/vmware/cmddiscovery.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connectors/vmware/src/centreon/vmware/cmddiscovery.pm b/connectors/vmware/src/centreon/vmware/cmddiscovery.pm index db19108af..5fc3bdabf 100644 --- a/connectors/vmware/src/centreon/vmware/cmddiscovery.pm +++ b/connectors/vmware/src/centreon/vmware/cmddiscovery.pm @@ -100,7 +100,9 @@ sub run { foreach my $child (@{$childs}) { next if (!$child->childEntity); my %types = map { $_ => 1 } @{$child->childType}; - next if (!defined($types{ComputeResource})); + my %entities = map { $_->type => 1 } @{$child->childEntity}; + next if (!defined($types{ComputeResource}) || (!defined($entities{ClusterComputeResource}) && + !defined($entities{ComputeResource}))); my @properties = ('name', 'host'); my $clusters = centreon::vmware::common::get_views($self->{connector}, \@{$child->childEntity}, \@properties);