From 781c6669a75d3b2277a3de6ab969ddbecf7cfbbc Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 28 May 2015 16:13:07 +0200 Subject: [PATCH] - Bug fix hp proliant snmp check --- hardware/server/hp/proliant/snmp/mode/components/lnic.pm | 4 ++-- hardware/server/hp/proliant/snmp/mode/components/pnic.pm | 2 +- hardware/server/hp/proliant/snmp/mode/components/psu.pm | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hardware/server/hp/proliant/snmp/mode/components/lnic.pm b/hardware/server/hp/proliant/snmp/mode/components/lnic.pm index 509d93b90..7f9525649 100644 --- a/hardware/server/hp/proliant/snmp/mode/components/lnic.pm +++ b/hardware/server/hp/proliant/snmp/mode/components/lnic.pm @@ -73,7 +73,7 @@ my $oid_cpqNicIfLogMapAdapterCount = '.1.3.6.1.4.1.232.18.2.2.1.1.5'; sub load { my (%options) = @_; - push @{$options{request}}, { oid => $oid_cpqNicIfLogMapEntry, start => $mapping->{cpqNicIfLogMapCondition}->{oid}, end => $mapping->{cpqNicIfLogMapStatus}->{oid} }; + push @{$options{request}}, { oid => $oid_cpqNicIfLogMapEntry, start => $mapping3->{cpqNicIfLogMapCondition}->{oid}, end => $mapping3->{cpqNicIfLogMapStatus}->{oid} }; push @{$options{request}}, { oid => $oid_cpqNicIfLogMapDescription }; push @{$options{request}}, { oid => $oid_cpqNicIfLogMapAdapterCount }; } @@ -95,7 +95,7 @@ sub check { next if ($self->check_exclude(section => 'lnic', instance => $instance)); $self->{components}->{lnic}->{total}++; - $self->{output}->output_add(long_msg => printf("logical nic '%s' [adapter count: %s, description: %s, status: %s] condition is %s.", + $self->{output}->output_add(long_msg => sprintf("logical nic '%s' [adapter count: %s, description: %s, status: %s] condition is %s.", $instance, $result2->{cpqNicIfLogMapAdapterCount}, centreon::plugins::misc::trim($result->{cpqNicIfLogMapDescription}), $result3->{cpqNicIfLogMapStatus}, $result3->{cpqNicIfLogMapCondition})); diff --git a/hardware/server/hp/proliant/snmp/mode/components/pnic.pm b/hardware/server/hp/proliant/snmp/mode/components/pnic.pm index 644f98529..f70f94922 100644 --- a/hardware/server/hp/proliant/snmp/mode/components/pnic.pm +++ b/hardware/server/hp/proliant/snmp/mode/components/pnic.pm @@ -88,7 +88,7 @@ my $oid_cpqNicIfPhysAdapterRole = '.1.3.6.1.4.1.232.18.2.3.1.1.3'; sub load { my (%options) = @_; - push @{$options{request}}, { oid => $oid_cpqNicIfPhysAdapterEntry, start => $mapping->{cpqNicIfPhysAdapterDuplexState}->{oid}, end => $mapping->{cpqNicIfPhysAdapterStatus}->{oid} }; + push @{$options{request}}, { oid => $oid_cpqNicIfPhysAdapterEntry, start => $mapping2->{cpqNicIfPhysAdapterDuplexState}->{oid}, end => $mapping2->{cpqNicIfPhysAdapterStatus}->{oid} }; push @{$options{request}}, { oid => $oid_cpqNicIfPhysAdapterRole }; } diff --git a/hardware/server/hp/proliant/snmp/mode/components/psu.pm b/hardware/server/hp/proliant/snmp/mode/components/psu.pm index 89f09921c..be041169c 100644 --- a/hardware/server/hp/proliant/snmp/mode/components/psu.pm +++ b/hardware/server/hp/proliant/snmp/mode/components/psu.pm @@ -119,7 +119,8 @@ sub check { $self->{output}->output_add(long_msg => sprintf("powersupply '%s' status is %s [redundance: %s, redundant partner: %s] (status %s).", $instance, $result->{cpqHeFltTolPowerSupplyCondition}, - $result->{cpqHeFltTolPowerSupplyRedundant}, $result2->{cpqHeFltTolPowerSupplyRedundantPartner}, + $result->{cpqHeFltTolPowerSupplyRedundant}, + defined($result2->{cpqHeFltTolPowerSupplyRedundantPartner}) ? $result2->{cpqHeFltTolPowerSupplyRedundantPartner} : 'unknown', $result->{cpqHeFltTolPowerSupplyStatus} )); my $exit = $self->get_severity(section => 'psu', value => $result->{cpqHeFltTolPowerSupplyCondition});