From 862267d9f447b6d1b5e0c77af711fe2e19efa291 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 27 Aug 2019 11:40:58 +0200 Subject: [PATCH] wip: vsan cluster usage --- .../src/centreon/script/centreon_vmware.pm | 2 +- .../src/centreon/vmware/cmdvsanclusterusage.pm | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/connectors/vmware/src/centreon/script/centreon_vmware.pm b/connectors/vmware/src/centreon/script/centreon_vmware.pm index 9c2bc46b3..7712b0371 100644 --- a/connectors/vmware/src/centreon/script/centreon_vmware.pm +++ b/connectors/vmware/src/centreon/script/centreon_vmware.pm @@ -95,7 +95,7 @@ my @load_modules = ( 'centreon::vmware::cmdtoolsvm', 'centreon::vmware::cmduptimehost', 'centreon::vmware::cmdvmoperationcluster', - 'centreon::vmware::cmdvsancluserusage', + 'centreon::vmware::cmdvsanclusterusage', ); sub new { diff --git a/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm b/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm index a5eb4917d..c51fcfc67 100644 --- a/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm +++ b/connectors/vmware/src/centreon/vmware/cmdvsanclusterusage.pm @@ -71,13 +71,10 @@ sub run { my $data = {}; foreach my $view (@$views) { - if (!defined($view->{configurationEx}->{vsanConfigInfo}) || $view->{configurationEx}->{vsanConfigInfo}->enabled != 1); + next if (!defined($view->{configurationEx}->{vsanConfigInfo}) || $view->{configurationEx}->{vsanConfigInfo}->enabled != 1); my $entity_value = $view->{mo_ref}->{value}; - $data->{$entity_value} = { - name => $view->{name}, - }; - + my $uuid = $view->{configurationEx}->{vsanConfigInfo}->{defaultConfig}->{uuid}; my $result = centreon::vmware::common::vsan_get_performances( vsan_performance_mgr => $vsan_performance_mgr, cluster => $view, @@ -95,10 +92,13 @@ sub run { interval => $interval_sec, time_shift => $self->{time_shift} ); - - use Data::Dumper; print Data::Dumper::Dumper($result); + $data->{$entity_value} = { + name => $view->{name}, + cluster_domcompmgr => %{$result->{'cluster-domcompmgr:' . $uuid}}, + }; } - + + use Data::Dumper; print Data::Dumper::Dumper($data); centreon::vmware::common::set_response(data => $data); }