From cdcc681d43f964120fb5ffac537cec5ef47defe7 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 24 Jul 2016 14:10:48 +0200 Subject: Change color of speed to white for 0 Signed-off-by: Florian Pritz --- qos.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qos.pl') diff --git a/qos.pl b/qos.pl index a76ea97..5c7787d 100755 --- a/qos.pl +++ b/qos.pl @@ -60,6 +60,7 @@ my %bwthresh = ( crit => 80, ); my %bwcolors = ( + none => "white", ok => "green", warn => "rgb531", crit => "red", @@ -126,7 +127,9 @@ sub format_rate_color { if ($colored_rates) { $relrate = $bytes/128 * 100.00 / $bandwidth{$direction}; - if ($relrate >= $bwthresh{crit}) { + if ($relrate == 0) { + $color = $bwcolors{none}; + } elsif ($relrate >= $bwthresh{crit}) { $color = $bwcolors{crit}; } elsif ($relrate >= $bwthresh{warn}) { $color = $bwcolors{warn}; -- cgit v1.2.3-24-g4f1b