Update globalstatus.pm

test iDrac6 and iDrac7 ok :)
This commit is contained in:
Yann Beulque 2015-05-19 15:55:23 +02:00
parent 1cd6fc7ef9
commit efef232d62
1 changed files with 6 additions and 6 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_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();