From 1cd6fc7ef9137db60d1c22c46afc72724f4a99fc Mon Sep 17 00:00:00 2001 From: Yann Beulque Date: Tue, 19 May 2015 14:53:41 +0200 Subject: [PATCH 1/2] + bugfix iDrac > 6 --- hardware/server/dell/idrac/snmp/mode/globalstatus.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/server/dell/idrac/snmp/mode/globalstatus.pm b/hardware/server/dell/idrac/snmp/mode/globalstatus.pm index 563069482..043e11c7c 100644 --- a/hardware/server/dell/idrac/snmp/mode/globalstatus.pm +++ b/hardware/server/dell/idrac/snmp/mode/globalstatus.pm @@ -78,7 +78,7 @@ sub run { my $result = $self->{snmp}->get_leef(oids => [$oid_drsGlobalSystemStatus, $oid_globalSystemStatus, $oid_globalStorageStatus], nothing_quit => 1); # iDrac 6 - if (defined($result->{$oid_drsGlobalSystemStatus})) { + if (!defined($result->{$oid_globalSystemStatus})) { $self->{output}->output_add(severity => ${$states{$result->{$oid_drsGlobalSystemStatus}}}[1], short_msg => sprintf("Overall global status is '%s'", ${$states{$result->{$oid_drsGlobalSystemStatus}}}[0])); @@ -107,4 +107,4 @@ Check the overall status of iDrac card. =back =cut - \ No newline at end of file + From efef232d62936a41afbeb2e45a2f0dce3d23f802 Mon Sep 17 00:00:00 2001 From: Yann Beulque Date: Tue, 19 May 2015 15:55:23 +0200 Subject: [PATCH 2/2] Update globalstatus.pm test iDrac6 and iDrac7 ok :) --- hardware/server/dell/idrac/snmp/mode/globalstatus.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hardware/server/dell/idrac/snmp/mode/globalstatus.pm b/hardware/server/dell/idrac/snmp/mode/globalstatus.pm index 043e11c7c..1ec788494 100644 --- a/hardware/server/dell/idrac/snmp/mode/globalstatus.pm +++ b/hardware/server/dell/idrac/snmp/mode/globalstatus.pm @@ -77,18 +77,18 @@ sub run { my $oid_globalStorageStatus = '.1.3.6.1.4.1.674.10892.5.2.3.0'; my $result = $self->{snmp}->get_leef(oids => [$oid_drsGlobalSystemStatus, $oid_globalSystemStatus, $oid_globalStorageStatus], nothing_quit => 1); - # iDrac 6 - if (!defined($result->{$oid_globalSystemStatus})) { - $self->{output}->output_add(severity => ${$states{$result->{$oid_drsGlobalSystemStatus}}}[1], - short_msg => sprintf("Overall global status is '%s'", - ${$states{$result->{$oid_drsGlobalSystemStatus}}}[0])); - } else { # iDrac > 6 + # iDrac > 6 + if (defined($result->{$oid_globalSystemStatus})) { $self->{output}->output_add(severity => ${$states{$result->{$oid_globalSystemStatus}}}[1], short_msg => sprintf("Overall global status is '%s'", ${$states{$result->{$oid_globalSystemStatus}}}[0])); $self->{output}->output_add(severity => ${$states{$result->{$oid_globalStorageStatus}}}[1], short_msg => sprintf("Overall storage status is '%s'", ${$states{$result->{$oid_globalStorageStatus}}}[0])); + } else { # iDrac <= 6 + $self->{output}->output_add(severity => ${$states{$result->{$oid_drsGlobalSystemStatus}}}[1], + short_msg => sprintf("Overall global status is '%s'", + ${$states{$result->{$oid_drsGlobalSystemStatus}}}[0])); } $self->{output}->display(); $self->{output}->exit();