From efe08c996c2d0662488dd37db9f6ca656cec8754 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 17 Jan 2019 16:00:29 +0100 Subject: [PATCH] fix cassandra jmx --- database/cassandra/jmx/mode/cachesusage.pm | 5 +++-- database/cassandra/jmx/mode/clientrequestsusage.pm | 6 +++--- database/cassandra/jmx/mode/threadpoolsusage.pm | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/database/cassandra/jmx/mode/cachesusage.pm b/database/cassandra/jmx/mode/cachesusage.pm index 0d35b7bb0..74913e218 100644 --- a/database/cassandra/jmx/mode/cachesusage.pm +++ b/database/cassandra/jmx/mode/cachesusage.pm @@ -73,6 +73,7 @@ sub custom_usage_output { sub custom_usage_calc { my ($self, %options) = @_; + return -10 if ($options{new_datas}->{$self->{instance} . '_Capacity_Value'} <= 0); $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_Capacity_Value'}; $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_Size_Value'}; @@ -135,8 +136,8 @@ sub manage_selection { my $name = $1; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && - $name !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + $scope !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $scope . "': no matching filter.", debug => 1); next; } diff --git a/database/cassandra/jmx/mode/clientrequestsusage.pm b/database/cassandra/jmx/mode/clientrequestsusage.pm index 3b18e8a96..47e50c3db 100644 --- a/database/cassandra/jmx/mode/clientrequestsusage.pm +++ b/database/cassandra/jmx/mode/clientrequestsusage.pm @@ -86,7 +86,7 @@ sub new { return $self; } -sub prefix_thpool_output { +sub prefix_cr_output { my ($self, %options) = @_; return "Client Request '" . $options{instance_value}->{display} . "' "; @@ -111,8 +111,8 @@ sub manage_selection { my $name = $1; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && - $name !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + $scope !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $scope . "': no matching filter.", debug => 1); next; } diff --git a/database/cassandra/jmx/mode/threadpoolsusage.pm b/database/cassandra/jmx/mode/threadpoolsusage.pm index c5cabfa5f..f741903fb 100644 --- a/database/cassandra/jmx/mode/threadpoolsusage.pm +++ b/database/cassandra/jmx/mode/threadpoolsusage.pm @@ -121,8 +121,8 @@ sub manage_selection { my $name = $1; if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && - $name !~ /$self->{option_results}->{filter_name}/) { - $self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); + $scope !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping '" . $scope . "': no matching filter.", debug => 1); next; }