add filter by id
This commit is contained in:
parent
adfe6a05f0
commit
fdc9581613
|
@ -80,7 +80,8 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
|
'filter-id:s' => { name => 'filter_id' },
|
||||||
'filter-name:s' => { name => 'filter_name' },
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
'unknown-status:s' => { name => 'unknown_status', default => '' },
|
'unknown-status:s' => { name => 'unknown_status', default => '' },
|
||||||
'warning-status:s' => { name => 'warning_status', default => '' },
|
'warning-status:s' => { name => 'warning_status', default => '' },
|
||||||
|
@ -120,6 +121,11 @@ sub manage_selection {
|
||||||
$self->{output}->output_add(long_msg => "skipping monitor '" . $_->{MONITOR_NAME} . "': no matching filter.", debug => 1);
|
$self->{output}->output_add(long_msg => "skipping monitor '" . $_->{MONITOR_NAME} . "': no matching filter.", debug => 1);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
if (defined($self->{option_results}->{filter_id}) && $self->{option_results}->{filter_id} ne '' &&
|
||||||
|
$_->{MONITOR_ID} !~ /$self->{option_results}->{filter_id}/) {
|
||||||
|
$self->{output}->output_add(long_msg => "skipping monitor '" . $_->{MONITOR_NAME} . "': no matching filter.", debug => 1);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
my $start_date = POSIX::strftime('%d/%m/%Y %H:%M:%S', gmtime($time - ($_->{PERIODICITY} * 60 * 2)));
|
my $start_date = POSIX::strftime('%d/%m/%Y %H:%M:%S', gmtime($time - ($_->{PERIODICITY} * 60 * 2)));
|
||||||
my $kpi_detail = $options{custom}->request_api(
|
my $kpi_detail = $options{custom}->request_api(
|
||||||
|
@ -162,9 +168,13 @@ Check KPI.
|
||||||
Only display some counters (regexp can be used).
|
Only display some counters (regexp can be used).
|
||||||
Example: --filter-counters='status'
|
Example: --filter-counters='status'
|
||||||
|
|
||||||
|
=item B<--filter-id>
|
||||||
|
|
||||||
|
Filter by monitor id (can be a regexp).
|
||||||
|
|
||||||
=item B<--filter-name>
|
=item B<--filter-name>
|
||||||
|
|
||||||
Filter monitor name (can be a regexp).
|
Filter by monitor name (can be a regexp).
|
||||||
|
|
||||||
=item B<--unknown-status>
|
=item B<--unknown-status>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue