From 26b49db91a78b8a3a146158b5783f1492e82ab33 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Mon, 24 Mar 2014 19:43:52 +0100 Subject: [PATCH] Fix #5396 --- network/fritzbox/mode/traffic.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/network/fritzbox/mode/traffic.pm b/network/fritzbox/mode/traffic.pm index a4ee34c51..c4fd2e64c 100644 --- a/network/fritzbox/mode/traffic.pm +++ b/network/fritzbox/mode/traffic.pm @@ -117,10 +117,10 @@ sub run { # so if you want all in BYTE... # (8 BIT = 1 BYTE) # calc ($VAR / 8) - $NewLayer1UpstreamMaxBitRate = ($NewLayer1UpstreamMaxBitRate / 8); - $NewLayer1DownstreamMaxBitRate = ($NewLayer1DownstreamMaxBitRate / 8); - $new_datas->{in} = ($NewTotalBytesReceived); - $new_datas->{out} = ($NewTotalBytesSent); + $NewLayer1UpstreamMaxBitRate = ($NewLayer1UpstreamMaxBitRate); + $NewLayer1DownstreamMaxBitRate = ($NewLayer1DownstreamMaxBitRate); + $new_datas->{in} = ($NewTotalBytesReceived) * 8; + $new_datas->{out} = ($NewTotalBytesSent) * 8; $self->{statefile_value}->write(data => $new_datas); my $old_in = $self->{statefile_value}->get(name => 'in'); @@ -179,13 +179,13 @@ sub run { } $self->{output}->perfdata_add(label => 'traffic_in', - unit => 'B/s', + unit => 'b/s', value => sprintf("%.2f", $in_absolute_per_sec), warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-in', total => $NewLayer1DownstreamMaxBitRate), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-in', total => $NewLayer1DownstreamMaxBitRate), min => 0, max => $NewLayer1DownstreamMaxBitRate); $self->{output}->perfdata_add(label => 'traffic_out', - unit => 'B/s', + unit => 'b/s', value => sprintf("%.2f", $out_absolute_per_sec), warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-out', total => $NewLayer1UpstreamMaxBitRate), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-out', total => $NewLayer1UpstreamMaxBitRate), @@ -226,7 +226,7 @@ Threshold critical for 'out' traffic. =item B<--units> -Units of thresholds (Default: '%') ('%', 'B'). +Units of thresholds (Default: '%') ('%', 'b'). =item B<--hostname>