add endpoint filter for broker stats mode

This commit is contained in:
Colin Gagnaire 2019-02-07 11:08:56 +01:00
parent 4a31fb10b7
commit 9d9eed9a01
1 changed files with 11 additions and 0 deletions

View File

@ -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.