+ add max total latency option

This commit is contained in:
garnier-quentin 2016-05-26 15:51:54 +02:00
parent 690f9e7958
commit e9452dc6b8
1 changed files with 13 additions and 3 deletions

View File

@ -44,6 +44,8 @@ sub new {
"display-description" => { name => 'display_description' }, "display-description" => { name => 'display_description' },
"warning:s" => { name => 'warning' }, "warning:s" => { name => 'warning' },
"critical:s" => { name => 'critical' }, "critical:s" => { name => 'critical' },
"warning-max-total-latency:s" => { name => 'warning_max_total_latency' },
"critical-max-total-latency:s" => { name => 'critical_max_total_latency' },
"datastore-name:s" => { name => 'datastore_name' }, "datastore-name:s" => { name => 'datastore_name' },
"filter-datastore:s" => { name => 'filter_datastore' }, "filter-datastore:s" => { name => 'filter_datastore' },
}); });
@ -54,7 +56,7 @@ sub check_options {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->SUPER::init(%options); $self->SUPER::init(%options);
foreach my $label (('warning', 'critical')) { foreach my $label (('warning', 'critical', 'warning_max_total_latency', 'critical_max_total_latency')) {
if (($self->{perfdata}->threshold_validate(label => $label, value => $self->{option_results}->{$label})) == 0) { if (($self->{perfdata}->threshold_validate(label => $label, value => $self->{option_results}->{$label})) == 0) {
my ($label_opt) = $label; my ($label_opt) = $label;
$label_opt =~ tr/_/-/; $label_opt =~ tr/_/-/;
@ -146,6 +148,14 @@ Threshold warning in IOPs.
Threshold critical in IOPs. Threshold critical in IOPs.
=item B<--warning-max-total-latency>
Threshold warning in ms.
=item B<--critical-max-total-latency>
Threshold critical in ms.
=back =back
=cut =cut