summaryrefslogtreecommitdiffstats
path: root/qos.pl
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-07-24 14:10:48 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-24 14:10:48 +0200
commitcdcc681d43f964120fb5ffac537cec5ef47defe7 (patch)
treeb7ba52ef50c5db14330e8a35679242a87028c2d2 /qos.pl
parent92f2d44f4277a2690f3990d06971c9ec81ec1a78 (diff)
downloadqos-cdcc681d43f964120fb5ffac537cec5ef47defe7.tar.gz
qos-cdcc681d43f964120fb5ffac537cec5ef47defe7.tar.xz
Change color of speed to white for 0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'qos.pl')
-rwxr-xr-xqos.pl5
1 files changed, 4 insertions, 1 deletions
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};