diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ilo.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ilo.pm index b10f68f17..e7f9a19be 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ilo.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/ilo.pm @@ -68,8 +68,8 @@ sub check { $self->{components}->{ilo} = {name => 'ilo', total => 0, skip => 0}; return if ($self->check_filter(section => 'ilo')); - return if (scalar(keys %{$self->{results}->{$mapping->{cpqSm2MibCondition}->{oid}}}) == 0); - my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{cpqSm2MibCondition}->{oid}}, instance => '0'); + return if (scalar(keys %{$self->{results}->{$mapping->{cpqSm2MibCondition}->{oid}}}) <= 0); + my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$mapping->{cpqSm2MibCondition}->{oid}}, instance => 0); next if ($self->check_filter(section => 'ilo', instance => '0')); $self->{components}->{ilo}->{total}++; @@ -83,14 +83,22 @@ sub check { } } - $self->{output}->output_add(long_msg => sprintf("ilo status is %s [message = %s].", - $result->{cpqSm2MibCondition}, join(', ', @message_error))); + $self->{output}->output_add( + long_msg => sprintf( + "ilo status is %s [message = %s].", + $result->{cpqSm2MibCondition}, join(', ', @message_error) + ) + ); my $exit = $self->get_severity(label => 'default', section => 'ilo', value => $result->{cpqSm2MibCondition}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("ilo is %s", - $result->{cpqSm2MibCondition})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf( + "ilo is %s", + $result->{cpqSm2MibCondition} + ) + ); } } -1; \ No newline at end of file +1; diff --git a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/memory.pm b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/memory.pm index ca1f1c66f..0b20d8e54 100644 --- a/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/memory.pm +++ b/centreon-plugins/hardware/server/hp/proliant/snmp/mode/components/memory.pm @@ -61,6 +61,8 @@ sub check { $self->{components}->{memory} = { name => 'memory', total => 0, skip => 0 }; return if ($self->check_filter(section => 'memory')); + return if (scalar(keys %{$self->{results}->{$oid_cpqHeResMem2Module}}) <= 0); + $self->{snmp}->load( oids => [map($_->{oid}, values(%$mapping))], instances => [values(%{$self->{results}->{$oid_cpqHeResMem2Module}})]