From 6c6506bcbada3b583a29dab297aaa2238f1799f4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 7 Jul 2015 14:17:18 +0200 Subject: [PATCH] + Fix bigip mode --- network/f5/bigip/mode/nodestatus.pm | 3 ++- network/f5/bigip/mode/poolstatus.pm | 3 ++- network/f5/bigip/mode/virtualserverstatus.pm | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/network/f5/bigip/mode/nodestatus.pm b/network/f5/bigip/mode/nodestatus.pm index 6d6dd8e68..a2216b2e3 100644 --- a/network/f5/bigip/mode/nodestatus.pm +++ b/network/f5/bigip/mode/nodestatus.pm @@ -163,7 +163,7 @@ sub run { my $obj = $maps_counters->{node}->{$_}->{obj}; $obj->set(instance => $id); - my ($value_check) = $obj->execute(values => $self->{N}->{$id}); + my ($value_check) = $obj->execute(values => $self->{node}->{$id}); if ($value_check != 0) { $long_msg .= $long_msg_append . $obj->output_error(); @@ -287,6 +287,7 @@ sub manage_selection { next; } $result->{StatusReason} = '-' if (!defined($result->{StatusReason}) || $result->{StatusReason} eq ''); + $result->{Name} = centreon::plugins::misc::trim($result->{Name}); $self->{node}->{$instance} = { %$result }; } diff --git a/network/f5/bigip/mode/poolstatus.pm b/network/f5/bigip/mode/poolstatus.pm index 12c95a97c..6324b5395 100644 --- a/network/f5/bigip/mode/poolstatus.pm +++ b/network/f5/bigip/mode/poolstatus.pm @@ -163,7 +163,7 @@ sub run { my $obj = $maps_counters->{pool}->{$_}->{obj}; $obj->set(instance => $id); - my ($value_check) = $obj->execute(values => $self->{N}->{$id}); + my ($value_check) = $obj->execute(values => $self->{pool}->{$id}); if ($value_check != 0) { $long_msg .= $long_msg_append . $obj->output_error(); @@ -277,6 +277,7 @@ sub manage_selection { $result->{Name} = ''; $result->{Name} .= chr foreach (split /\./, $instance); + $result->{Name} = centreon::plugins::misc::trim($result->{Name}); if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $result->{Name} !~ /$self->{option_results}->{filter_name}/) { $self->{output}->output_add(long_msg => "Skipping '" . $result->{Name} . "': no matching filter name."); diff --git a/network/f5/bigip/mode/virtualserverstatus.pm b/network/f5/bigip/mode/virtualserverstatus.pm index f6e40f1cc..02430554d 100644 --- a/network/f5/bigip/mode/virtualserverstatus.pm +++ b/network/f5/bigip/mode/virtualserverstatus.pm @@ -40,6 +40,7 @@ use base qw(centreon::plugins::mode); use strict; use warnings; use centreon::plugins::values; +use centreon::plugins::misc; my $thresholds = { vs => [ @@ -163,7 +164,7 @@ sub run { my $obj = $maps_counters->{vs}->{$_}->{obj}; $obj->set(instance => $id); - my ($value_check) = $obj->execute(values => $self->{N}->{$id}); + my ($value_check) = $obj->execute(values => $self->{vs}->{$id}); if ($value_check != 0) { $long_msg .= $long_msg_append . $obj->output_error(); @@ -277,6 +278,7 @@ sub manage_selection { $result->{Name} = ''; $result->{Name} .= chr foreach (split /\./, $instance); + $result->{Name} = centreon::plugins::misc::trim($result->{Name}); if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $result->{Name} !~ /$self->{option_results}->{filter_name}/) { $self->{output}->output_add(long_msg => "Skipping '" . $result->{Name} . "': no matching filter name.");