Fix on gloabal status component #5151

This commit is contained in:
Kevin Duret 2014-01-31 14:32:54 +01:00
parent 8a3fee2a1e
commit c20e750e63
2 changed files with 16 additions and 5 deletions

View File

@ -45,14 +45,21 @@ my %status = (
);
sub check {
my ($self, %options) = @_;
# $options{snmp} = snmp object
$self->{snmp} = $options{snmp};
my ($self) = @_;
# In MIB '10892.mib'
$self->{output}->output_add(long_msg => "Checking global system status");
return if ($self->check_exclude('globalstatus'));
my $oid_globalSystemStatus = '.1.3.6.1.4.1.674.10892.1.200.10.1.2.1';
my $result = $self->{snmp}->get_leef(oids => [$oid_globalSystemStatus], nothing_quit => 1);
$self->{output}->output_add(severity => ${$status{$result->{$oid_globalSystemStatus}}}[1],
$self->{output}->output_add(long_msg => sprintf("Overall global status is '%s'.",
${$status{$result->{$oid_globalSystemStatus}}}[0]
));
if ($result->{$oid_globalSystemStatus} != 3) {
$self->{output}->output_add(severity => ${$status{$result->{$oid_globalSystemStatus}}}[1],
short_msg => sprintf("Overall global status is '%s'",
${$status{$result->{$oid_globalSystemStatus}}}[0]));
}

View File

@ -42,6 +42,8 @@ use warnings;
use centreon::plugins::misc;
use hardware::server::dell::openmanage::mode::components::fan;
use hardware::server::dell::openmanage::mode::components::psu;
use hardware::server::dell::openmanage::mode::components::temperature;
use hardware::server::dell::openmanage::mode::components::globalstatus;
sub new {
my ($class, %options) = @_;
@ -70,9 +72,11 @@ sub run {
$self->{snmp} = $options{snmp};
$self->get_system_information();
hardware::server::dell::openmanage::mode::components::globalstatus::check($self);
hardware::server::dell::openmanage::mode::components::fan::check($self);
hardware::server::dell::openmanage::mode::components::psu::check($self);
hardware::server::dell::openmanage::mode::components::temperature::check($self);
my $total_components = 0;
my $display_by_component = '';
my $display_by_component_append = '';