+ Fix hardware cisco f5 bigip

This commit is contained in:
garnier-quentin 2015-12-18 10:24:23 +01:00
parent 6b13062ee1
commit 427d021a63
2 changed files with 8 additions and 10 deletions

View File

@ -24,7 +24,7 @@ use strict;
use warnings; use warnings;
my $mapping = { my $mapping = {
sysChassisTempTemperature => { oid => '.1.3.6.1.4.1.3375.2.1.3.2.3.2.1.2', map => \%map_status }, sysChassisTempTemperature => { oid => '.1.3.6.1.4.1.3375.2.1.3.2.3.2.1.2' },
}; };
sub load { sub load {
@ -54,7 +54,7 @@ sub check {
if (defined($result->{sysChassisTempTemperature}) && $result->{sysChassisTempTemperature} =~ /[0-9]/) { if (defined($result->{sysChassisTempTemperature}) && $result->{sysChassisTempTemperature} =~ /[0-9]/) {
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{sysChassisTempTemperature}); my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{sysChassisTempTemperature});
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit, $self->{output}->output_add(severity => $exit,
short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature})); short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature}));
} }

View File

@ -32,6 +32,11 @@ my $thresholds = {
['good', 'OK'], ['good', 'OK'],
['notPresent', 'OK'], ['notPresent', 'OK'],
], ],
psu => [
['bad', 'CRITICAL'],
['good', 'OK'],
['notPresent', 'OK'],
],
}; };
sub new { sub new {
@ -74,13 +79,6 @@ sub check_options {
push @{$self->{absent_problem}}, { filter => $values[0], instance => $values[1] }; push @{$self->{absent_problem}}, { filter => $values[0], instance => $values[1] };
} }
$self->{absent_problem} = [];
foreach my $val (@{$self->{option_results}->{absent_problem}}) {
next if (!defined($val) || $val eq '');
my @values = split (/,/, $val);
push @{$self->{absent_problem}}, { filter => $values[0], instance => $values[1] };
}
$self->{overload_th} = {}; $self->{overload_th} = {};
foreach my $val (@{$self->{option_results}->{threshold_overload}}) { foreach my $val (@{$self->{option_results}->{threshold_overload}}) {
next if (!defined($val) || $val eq ''); next if (!defined($val) || $val eq '');
@ -117,7 +115,7 @@ sub check_options {
$self->{output}->option_exit(); $self->{output}->option_exit();
} }
my ($section, $instance, $value) = ($1, $2, $3); my ($section, $instance, $value) = ($1, $2, $3);
if (!defined($thresholds->{$section})) { if ($section !~ /^(temperature|fan)$/) {
$self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'."); $self->{output}->add_option_msg(short_msg => "Wrong $option option '" . $val . "'.");
$self->{output}->option_exit(); $self->{output}->option_exit();
} }