diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2020-11-17 16:32:23 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2023-08-07 16:59:22 +0900 |
commit | 654e12fd07d119d0ff7742aec2b1bcd5e99aa1ab (patch) | |
tree | 9d010e064b8033a401d50df6e42de33010700f84 | |
parent | 42f4b9fe1661059bb837d78371a38f43813304e3 (diff) | |
download | smokeping-654e12fd07d119d0ff7742aec2b1bcd5e99aa1ab.tar.gz |
use loss_background from params
-rw-r--r-- | lib/Smokeping.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 64eb36c..39cf230 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1385,6 +1385,10 @@ sub get_detail ($$$$;$){ my @lossargs = (); my @losssmoke = (); my $last = -1; + my $use_loss_background = $cfg->{Presentation}{detail}{loss_background} and $cfg->{Presentation}{detail}{loss_background} eq 'yes'; + if ($q->param('loss_background') and $q->param('loss_background') =~ /yes|no/) { + $use_loss_background = $q->param('loss_background') eq "yes"; + } foreach my $loss (sort {$a <=> $b} keys %lc){ next if $loss > $pings; my $lvar = $loss; $lvar =~ s/\./d/g ; @@ -1397,7 +1401,7 @@ sub get_detail ($$$$;$){ "STACK:meH$lvar$lc{$loss}[1]:$lc{$loss}[0]" # "LINE2:me$lvar$lc{$loss}[1]:$lc{$loss}[0]" ); - if ($cfg->{Presentation}{detail}{loss_background} and $cfg->{Presentation}{detail}{loss_background} eq 'yes') { + if ($use_loss_background) { push @lossargs, ( "CDEF:lossbg$lvar=loss,$last,GT,loss,$loss,LE,*,INF,UNKN,IF", @@ -1415,7 +1419,7 @@ sub get_detail ($$$$;$){ # if we have uptime draw a colorful background or the graph showing the uptime my $cdir=dyndir($cfg)."/".(join "/", @dirs)."/"; - if ((not defined $cfg->{Presentation}{detail}{loss_background} or $cfg->{Presentation}{detail}{loss_background} ne 'yes') && + if ((not $use_loss_background) && (-f "$cdir/${file}.adr")) { @upsmoke = (); @upargs = ("COMMENT:Link Up${BS}: ", |