From 427d021a638ea23a52835c9f99be8dad0abbe92d Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 18 Dec 2015 10:24:23 +0100 Subject: [PATCH] + Fix hardware cisco f5 bigip --- .../f5/bigip/mode/components/temperature.pm | 4 ++-- centreon-plugins/network/f5/bigip/mode/hardware.pm | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/centreon-plugins/network/f5/bigip/mode/components/temperature.pm b/centreon-plugins/network/f5/bigip/mode/components/temperature.pm index fd8b1b90b..db65b271c 100644 --- a/centreon-plugins/network/f5/bigip/mode/components/temperature.pm +++ b/centreon-plugins/network/f5/bigip/mode/components/temperature.pm @@ -24,7 +24,7 @@ use strict; use warnings; 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 { @@ -54,7 +54,7 @@ sub check { if (defined($result->{sysChassisTempTemperature}) && $result->{sysChassisTempTemperature} =~ /[0-9]/) { 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, short_msg => sprintf("Temperature '%s' is %.2f C", $instance, $result->{sysChassisTempTemperature})); } diff --git a/centreon-plugins/network/f5/bigip/mode/hardware.pm b/centreon-plugins/network/f5/bigip/mode/hardware.pm index 631a02f5e..55f74d3e4 100644 --- a/centreon-plugins/network/f5/bigip/mode/hardware.pm +++ b/centreon-plugins/network/f5/bigip/mode/hardware.pm @@ -32,6 +32,11 @@ my $thresholds = { ['good', 'OK'], ['notPresent', 'OK'], ], + psu => [ + ['bad', 'CRITICAL'], + ['good', 'OK'], + ['notPresent', 'OK'], + ], }; sub new { @@ -74,13 +79,6 @@ sub check_options { 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} = {}; foreach my $val (@{$self->{option_results}->{threshold_overload}}) { next if (!defined($val) || $val eq ''); @@ -117,7 +115,7 @@ sub check_options { $self->{output}->option_exit(); } 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}->option_exit(); }