Fix ibm bladecenter check

This commit is contained in:
Quentin Garnier 2015-03-11 16:46:18 +11:00
parent 7b124eee91
commit 2ab40f5490
4 changed files with 16 additions and 10 deletions

View File

@ -92,16 +92,22 @@ sub check {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_bladeSystemStatusEntry}, instance => $instance);
next if ($self->check_exclude(section => 'blade', instance => $result->{bladeId}));
next if ($result->{bladeExists} =~ /No/i &&
next if ($result->{bladeExists} =~ /No/i &&
$self->absent_problem(section => 'blade', instance => $result->{bladeId}));
$self->{components}->{blade}->{total}++;
if ($result->{bladePowerState} =~ /off/) {
$self->{output}->output_add(long_msg => sprintf("Blade '%s' power state is %s",
$result->{bladeId}, $result->{bladePowerState}));
next;
}
$self->{output}->output_add(long_msg => sprintf("Blade '%s' state is %s [power state: %s]",
$result->{bladeId}, $result->{bladeHealthState}, $result->{bladePowerState}));
my $exit = $self->get_severity(section => 'blade', value => $result->{bladeHealthState});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power module '%s' state is %s",
short_msg => sprintf("Blade '%s' state is %s",
$result->{bladeId}, $result->{bladeHealthState}));
}
}

View File

@ -72,12 +72,12 @@ sub check {
$self->{components}->{blower} = {name => 'blowers', total => 0, skip => 0};
return if ($self->check_exclude(section => 'blower'));
while (my $i = 0; $i < $count; $i++) {
for (my $i = 0; $i < $count; $i++) {
my $instance = $i + 1;
next if (!defined($map_blower_state{$oid_blowers . '.' . ($entry_blower_state + $i) . '.0'}));
my $blower_state = $map_blower_state{$oid_blowers . '.' . ($entry_blower_state + $i) . '.0'};
my $blower_speed = defined($map_blower_state{$oid_blowers . '.' . ($entry_blower_speed + $i) . '.0'}) ? $map_blower_state{$oid_blowers . '.' . ($entry_blower_speed + $i) . '.0'} : undef;
my $ctrl_state = defined($map_blower_state{$oid_blowers . '.' . ($entry_controller_state + $i) . '.0'}) ? $map_blower_state{$oid_blowers . '.' . ($entry_controller_state + $i) . '.0'} : undef;
next if (!defined($self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_blower_state + $i) . '.0'}));
my $blower_state = $map_blower_state{$self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_blower_state + $i) . '.0'}};
my $blower_speed = defined($self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_blower_speed + $i) . '.0'}) ? $map_blower_state{$self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_blower_speed + $i) . '.0'}} : undef;
my $ctrl_state = defined($self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_controller_state + $i) . '.0'}) ? $map_blower_state{$self->{results}->{$oid_blowers}->{$oid_blowers . '.' . ($entry_controller_state + $i) . '.0'}} : undef;
next if ($self->check_exclude(section => 'blower', instance => $instance));
next if ($blower_state =~ /No Blower/i &&

View File

@ -77,7 +77,7 @@ sub check {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_powerModuleHealthEntry}, instance => $instance);
next if ($self->check_exclude(section => 'powermodule', instance => $instance));
next if ($result->{powerModuleExists} =~ /No/i &&
next if ($result->{powerModuleExists} =~ /No/i &&
$self->absent_problem(section => 'powermodule', instance => $instance));
$self->{components}->{powermodule}->{total}++;

View File

@ -173,7 +173,7 @@ sub run {
foreach (@components) {
if (/$self->{option_results}->{component}/) {
my $mod_name = "ardware::server::ibm::bladecenter::snmp::mode::components::$_";
my $mod_name = "hardware::server::ibm::bladecenter::snmp::mode::components::$_";
my $func = $mod_name->can('check');
$func->($self);
}