diff --git a/hardware/server/dell/idrac/snmp/mode/globalstatus.pm b/hardware/server/dell/idrac/snmp/mode/globalstatus.pm index 6db7c0e25..563069482 100644 --- a/hardware/server/dell/idrac/snmp/mode/globalstatus.pm +++ b/hardware/server/dell/idrac/snmp/mode/globalstatus.pm @@ -72,17 +72,24 @@ sub run { # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; + my $oid_drsGlobalSystemStatus = '.1.3.6.1.4.1.674.10892.2.2.1.0'; my $oid_globalSystemStatus = '.1.3.6.1.4.1.674.10892.5.2.1.0'; my $oid_globalStorageStatus = '.1.3.6.1.4.1.674.10892.5.2.3.0'; - my $result = $self->{snmp}->get_leef(oids => [$oid_globalSystemStatus, $oid_globalStorageStatus], nothing_quit => 1); + my $result = $self->{snmp}->get_leef(oids => [$oid_drsGlobalSystemStatus, $oid_globalSystemStatus, $oid_globalStorageStatus], nothing_quit => 1); - $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])); - + # iDrac 6 + if (defined($result->{$oid_drsGlobalSystemStatus})) { + $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 + $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])); + } $self->{output}->display(); $self->{output}->exit(); }