Merge pull request #59 from Gilum/patch-3

+ bugfix iDrac > 6
This commit is contained in:
qgarnier 2015-05-19 16:34:27 +02:00
commit f30944d2ff
1 changed files with 7 additions and 7 deletions

View File

@ -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_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
# 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();
@ -107,4 +107,4 @@ Check the overall status of iDrac card.
=back
=cut