mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
fix error in logs from net-host
This commit is contained in:
parent
6c75fd1868
commit
485a4518ff
@ -1,5 +1,6 @@
|
||||
2020-04-06 Quentin Garnier <qgarnier@centreon.com> - 3.1.2
|
||||
* Enhancement: add drs and das config enable 'cluster-status'
|
||||
* Fix: remove errors in logs 'net-host'
|
||||
|
||||
2020-02-20 Quentin Garnier <qgarnier@centreon.com> - 3.1.1
|
||||
* Fix: discovery folders management
|
||||
|
@ -37,8 +37,8 @@ sub new {
|
||||
sub checkArgs {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq "") {
|
||||
centreon::vmware::common::set_response(code => 100, short_message => "Argument error: esx hostname cannot be null");
|
||||
if (defined($options{arguments}->{esx_hostname}) && $options{arguments}->{esx_hostname} eq '') {
|
||||
centreon::vmware::common::set_response(code => 100, short_message => 'Argument error: esx hostname cannot be null');
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -85,9 +85,10 @@ sub run {
|
||||
# Get Name from proxySwitch
|
||||
if (defined($entity_view->{'config.network.proxySwitch'})) {
|
||||
foreach (@{$entity_view->{'config.network.proxySwitch'}}) {
|
||||
$data->{$entity_value}->{proxyswitch}->{$_->{name}} = { pnic => [] };
|
||||
my $name = defined($_->{name}) ? $_->{name} : $_->{key};
|
||||
$data->{$entity_value}->{proxyswitch}->{$name} = { pnic => [] };
|
||||
next if (!defined($_->{pnic}));
|
||||
push @{$data->{$entity_value}->{proxyswitch}->{$_->{name}}->{pnic}}, @{$_->{pnic}};
|
||||
push @{$data->{$entity_value}->{proxyswitch}->{$name}->{pnic}}, @{$_->{pnic}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,27 +106,29 @@ sub run {
|
||||
}
|
||||
|
||||
push @$query_perfs, {
|
||||
entity => $entity_view,
|
||||
metrics => [
|
||||
{label => 'net.received.average', instances => $instances},
|
||||
{label => 'net.transmitted.average', instances => $instances},
|
||||
{label => 'net.droppedRx.summation', instances => $instances},
|
||||
{label => 'net.droppedTx.summation', instances => $instances},
|
||||
{label => 'net.packetsRx.summation', instances => $instances},
|
||||
{label => 'net.packetsTx.summation', instances => $instances}
|
||||
]
|
||||
};
|
||||
entity => $entity_view,
|
||||
metrics => [
|
||||
{label => 'net.received.average', instances => $instances},
|
||||
{label => 'net.transmitted.average', instances => $instances},
|
||||
{label => 'net.droppedRx.summation', instances => $instances},
|
||||
{label => 'net.droppedTx.summation', instances => $instances},
|
||||
{label => 'net.packetsRx.summation', instances => $instances},
|
||||
{label => 'net.packetsTx.summation', instances => $instances}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
# Nothing to retrieve. problem before already.
|
||||
return if (scalar(@$query_perfs) == 0);
|
||||
|
||||
my $values = centreon::vmware::common::generic_performance_values_historic($self->{connector},
|
||||
undef,
|
||||
$query_perfs,
|
||||
$self->{connector}->{perfcounter_speriod},
|
||||
sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift},
|
||||
skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1);
|
||||
my $values = centreon::vmware::common::generic_performance_values_historic(
|
||||
$self->{connector},
|
||||
undef,
|
||||
$query_perfs,
|
||||
$self->{connector}->{perfcounter_speriod},
|
||||
sampling_period => $self->{sampling_period}, time_shift => $self->{time_shift},
|
||||
skip_undef_counter => 1, multiples => 1, multiples_result_by_entity => 1
|
||||
);
|
||||
return if (centreon::vmware::common::performance_errors($self->{connector}, $values) == 1);
|
||||
|
||||
foreach my $entity_view (@$result) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user