+ enhance mode hardware iDrac: work now with iDrac 6 also

Thanks Gilum!!
Still need to work on iDrac 8 to have more detailed information (mode hardware)
This commit is contained in:
garnier-quentin 2015-05-18 21:03:50 +02:00
parent 28620d51eb
commit aeb31bbc33
1 changed files with 15 additions and 8 deletions

View File

@ -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();
}