diff --git a/connectors/vmware/src/centreon/esxd/cmddatastoreiops.pm b/connectors/vmware/src/centreon/esxd/cmddatastoreiops.pm index cae46986a..b6517f582 100644 --- a/connectors/vmware/src/centreon/esxd/cmddatastoreiops.pm +++ b/connectors/vmware/src/centreon/esxd/cmddatastoreiops.pm @@ -96,6 +96,7 @@ sub run { #my %uuid_list = (); my %disk_name = (); my %datastore_lun = (); + my $ds_checked = 0; foreach (@$result) { next if (centreon::esxd::common::datastore_state(connector => $self->{obj_esxd}, name => $_->{'summary.name'}, @@ -106,6 +107,7 @@ sub run { if ($_->info->isa('VmfsDatastoreInfo')) { #$uuid_list{$_->volume->uuid} = $_->volume->name; # Not need. We are on Datastore level (not LUN level) + $ds_checked = 1; foreach my $extent (@{$_->info->vmfs->extent}) { $disk_name{$extent->diskName} = $_->info->vmfs->name; if (!defined($datastore_lun{$_->info->vmfs->name})) { @@ -118,6 +120,12 @@ sub run { #} } + if ($ds_checked == 0) { + $self->{manager}->{output}->output_add(severity => 'UNKNOWN', + short_msg => "No Vmfs datastore(s) checked. Cannot get iops from Nas datastore(s)"); + return ; + } + my @vm_array = (); my %added_vm = (); foreach my $entity_view (@$result) { diff --git a/connectors/vmware/src/centreon/esxd/cmdlistdatastores.pm b/connectors/vmware/src/centreon/esxd/cmdlistdatastores.pm index 451199aa7..1d94f46ff 100644 --- a/connectors/vmware/src/centreon/esxd/cmdlistdatastores.pm +++ b/connectors/vmware/src/centreon/esxd/cmdlistdatastores.pm @@ -72,11 +72,13 @@ sub run { foreach my $datastore (@$result) { if (defined($self->{disco_show})) { $self->{manager}->{output}->add_disco_entry(name => $datastore->summary->name, - accessible => $datastore->summary->accessible); + accessible => $datastore->summary->accessible, + type => $datastore->summary->type); } else { - $self->{manager}->{output}->output_add(long_msg => sprintf(" %s [%s]", + $self->{manager}->{output}->output_add(long_msg => sprintf(" %s [%s] [%s]", $datastore->summary->name, - $datastore->summary->accessible)); + $datastore->summary->accessible, + $datastore->summary->type)); } }