From 9d9eed9a018cd2cfbd8df247f3c1f1798dc56583 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Thu, 7 Feb 2019 11:08:56 +0100 Subject: [PATCH] add endpoint filter for broker stats mode --- .../apps/centreon/local/mode/brokerstats.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/centreon-plugins/apps/centreon/local/mode/brokerstats.pm b/centreon-plugins/apps/centreon/local/mode/brokerstats.pm index 388a1d311..0a8f2ee80 100644 --- a/centreon-plugins/apps/centreon/local/mode/brokerstats.pm +++ b/centreon-plugins/apps/centreon/local/mode/brokerstats.pm @@ -163,6 +163,13 @@ sub manage_selection { my $endpoint = $entry; $endpoint =~ s/endpoint //; + + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $endpoint !~ /$self->{option_results}->{filter_name}/i) { + $self->{output}->output_add(long_msg => "skipping endpoint '" . $endpoint . "': no matching filter name"); + next; + } + my $state = $json->{$entry}->{state}; my $type = 'output'; $type = 'input' if (!defined($json->{$entry}->{status})); @@ -228,6 +235,10 @@ Use 'sudo' to execute the command. Specify the centreon-broker json stats file (Required). Can be multiple. +=item B<--filter-name> + +Filter endpoint name. + =item B<--warning-*> Threshold warning.