Fix empty for NasDatastores and type in list

This commit is contained in:
Quentin Garnier 2015-01-27 15:42:02 +01:00
parent 895f24100c
commit 2639799984
2 changed files with 13 additions and 3 deletions

View File

@ -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) {

View File

@ -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));
}
}