(plugin) database::mssql - mode failed-jobs add option --add-duration-perfdata (#3984)
* (plugin) database::mssql - mode failed-jobs add option --add-duration-perfdata * (plugin) database::mssql - mode failed-jobs add option --add-duration-perfdata
This commit is contained in:
parent
a966b94526
commit
7682247773
|
@ -40,7 +40,6 @@ sub custom_status_output {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub prefix_global_output {
|
sub prefix_global_output {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -90,7 +89,21 @@ sub set_counters {
|
||||||
{ name => 'runtime'}, { name => 'duration' }
|
{ name => 'runtime'}, { name => 'duration' }
|
||||||
],
|
],
|
||||||
closure_custom_output => $self->can('custom_status_output'),
|
closure_custom_output => $self->can('custom_status_output'),
|
||||||
closure_custom_perfdata => sub { return 0; },
|
closure_custom_perfdata => sub {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
if (defined($self->{instance_mode}->{option_results}->{add_duration_perfdata})) {
|
||||||
|
$self->{output}->perfdata_add(
|
||||||
|
nlabel => 'job.duration.seconds',
|
||||||
|
unit => 's',
|
||||||
|
instances => $self->{result_values}->{name},
|
||||||
|
value => sprintf('%s', $self->{result_values}->{duration}),
|
||||||
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||||
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||||
|
min => 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
closure_custom_threshold_check => \&catalog_status_threshold_ng
|
closure_custom_threshold_check => \&catalog_status_threshold_ng
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +119,8 @@ sub new {
|
||||||
'filter:s' => { name => 'filter' },
|
'filter:s' => { name => 'filter' },
|
||||||
'warning:s' => { name => 'warning', redirect => 'warning-jobs-failed-count' }, # legacy
|
'warning:s' => { name => 'warning', redirect => 'warning-jobs-failed-count' }, # legacy
|
||||||
'critical:s' => { name => 'critical', redirect => 'critical-jobs-failed-count' }, # legacy
|
'critical:s' => { name => 'critical', redirect => 'critical-jobs-failed-count' }, # legacy
|
||||||
'lookback:s' => { name => 'lookback' }
|
'lookback:s' => { name => 'lookback' },
|
||||||
|
'add-duration-perfdata' => { name => 'add_duration_perfdata' }
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -209,6 +223,10 @@ Filter job.
|
||||||
|
|
||||||
Check job history in minutes.
|
Check job history in minutes.
|
||||||
|
|
||||||
|
=item B<--add-duration-perfdata>
|
||||||
|
|
||||||
|
Display job duration time.
|
||||||
|
|
||||||
=item B<--warning-status>
|
=item B<--warning-status>
|
||||||
|
|
||||||
Set warning threshold for status.
|
Set warning threshold for status.
|
||||||
|
|
Loading…
Reference in New Issue