diff --git a/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm b/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm index ae1cbfd1f..974fc98c2 100644 --- a/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm +++ b/connectors/vmware/src/centreon/vmware/cmddatastorehost.pm @@ -103,12 +103,12 @@ sub run { if (scalar(@$instances) > 0) { push @$query_perfs, { - entity => $entity_view, - metrics => [ - {label => 'datastore.totalReadLatency.average', instances => $instances}, - {label => 'datastore.totalWriteLatency.average', instances => $instances} - ] - }; + entity => $entity_view, + metrics => [ + { label => 'datastore.totalReadLatency.average', instances => $instances }, + { label => 'datastore.totalWriteLatency.average', instances => $instances } + ] + }; } } diff --git a/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm b/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm index c51d6b63b..4fe4598e9 100644 --- a/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm +++ b/connectors/vmware/src/centreon/vmware/cmddatastoreusage.pm @@ -54,24 +54,24 @@ sub run { my $result = centreon::vmware::common::search_entities(command => $self, view_type => 'Datastore', properties => \@properties, filter => $filters); return if (!defined($result)); - + my $data = {}; foreach my $entity_view (@$result) { my $entity_value = $entity_view->{mo_ref}->{value}; - + $data->{$entity_value} = { name => $entity_view->summary->name, accessible => $entity_view->summary->accessible }; next if (centreon::vmware::common::is_accessible(accessible => $entity_view->summary->accessible) == 0); - + # capacity 0... if ($entity_view->summary->capacity <= 0) { $data->{$entity_value}->{size} = 0; next; } - + # in Bytes $data->{$entity_value}->{size} = $entity_view->summary->capacity; $data->{$entity_value}->{free} = $entity_view->summary->freeSpace; - + my ($total_uncommited, $prct_uncommited); my $msg_uncommited = ''; if (defined($entity_view->summary->uncommitted)) { diff --git a/connectors/vmware/src/centreon/vmware/common.pm b/connectors/vmware/src/centreon/vmware/common.pm index 984b8cfeb..93dcdb04a 100644 --- a/connectors/vmware/src/centreon/vmware/common.pm +++ b/connectors/vmware/src/centreon/vmware/common.pm @@ -499,14 +499,14 @@ sub search_entities { my $begin_views = []; foreach my $scope (['scope_datacenter', 'Datacenter'], ['scope_cluster', 'ClusterComputeResource'], ['scope_host', 'HostSystem']) { - if (defined($options{command}->{$$scope[0]}) && $options{command}->{$$scope[0]} ne '') { - my $filters = { name => qr/$options{command}->{$$scope[0]}/ }; + if (defined($options{command}->{$scope->[0]}) && $options{command}->{$scope->[0]} ne '') { + my $filters = { name => qr/$options{command}->{$scope->[0]}/ }; if (scalar(@$begin_views) > 0) { my $temp_views = []; while ((my $view = shift @$begin_views)) { my ($status, $views) = find_entity_views( connector => $options{command}->{connector}, - view_type => $$scope[1], + view_type => $scope->[1], properties => $properties, filter => $filters, begin_entity => $view, @@ -518,12 +518,12 @@ sub search_entities { } if (scalar(@$temp_views) == 0) { - set_response(code => 1, short_message => "Cannot find '$$scope[1]' object"); + set_response(code => 1, short_message => "Cannot find '$scope->[1]' object"); return undef; } push @$begin_views, @$temp_views; } else { - my ($status, $views) = find_entity_views(connector => $options{command}->{connector}, view_type => $$scope[1], properties => $properties, filter => $filters); + my ($status, $views) = find_entity_views(connector => $options{command}->{connector}, view_type => $scope->[1], properties => $properties, filter => $filters); # We quit. No scope find return undef if ($status <= 0); push @$begin_views, @$views;