+ Fix output when no vm on the datastore
This commit is contained in:
parent
c39d908c15
commit
eaf8b91988
|
@ -154,6 +154,12 @@ sub run {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scalar(@vm_array) == 0) {
|
||||
$self->{manager}->{output}->output_add(severity => 'OK',
|
||||
short_msg => "No virtual machines on the datastore");
|
||||
return ;
|
||||
}
|
||||
|
||||
@properties = ('name', 'runtime.connectionState', 'runtime.powerState');
|
||||
my $result2 = centreon::vmware::common::get_views($self->{connector}, \@vm_array, \@properties);
|
||||
|
@ -169,6 +175,12 @@ sub run {
|
|||
}
|
||||
$ref_ids_vm{${$result2}[$i]->{mo_ref}->{value}} = ${$result2}[$i]->{name};
|
||||
}
|
||||
|
||||
if ($multiple == 0 && scalar(@{$result2}) == 0) {
|
||||
$self->{manager}->{output}->output_add(severity => 'OK',
|
||||
short_msg => "No active virtual machines on the datastore");
|
||||
return ;
|
||||
}
|
||||
|
||||
# Vsphere >= 4.1
|
||||
my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector},
|
||||
|
|
Loading…
Reference in New Issue