Fix local mode traffic linux

This commit is contained in:
Quentin Garnier 2014-08-26 14:07:17 +02:00
parent 8e35845546
commit 1f9dc3d0c4
1 changed files with 5 additions and 3 deletions

View File

@ -237,11 +237,13 @@ sub run {
$in_prct = sprintf("%.2f", $in_prct);
$out_prct = sprintf("%.2f", $out_prct);
} else {
$in_prct = '-';
$out_prct = '-';
}
if ($self->{option_results}->{units} ne '%') {
my $exit1 = $self->{perfdata}->threshold_check(value => $in_absolute_per_sec, threshold => [ { label => 'critical-in', 'exit_litteral' => 'critical' }, { label => 'warning-in', exit_litteral => 'warning' } ]);
my $exit2 = $self->{perfdata}->threshold_check(value => $out_absolute_per_sec, threshold => [ { label => 'critical-out', 'exit_litteral' => 'critical' }, { label => 'warning-out', exit_litteral => 'warning' } ]);
$exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]);
$in_prct = '-';
$out_prct = '-';
}
###########
@ -353,7 +355,7 @@ Threshold critical in percent for 'out' traffic.
=item B<--units>
Units of thresholds (Default: '%') ('%', 'B').
Units of thresholds (Default: 'B') ('%', 'B').
Percent can be used only if --speed is set.
=item B<--name>