From 80c593387051f0a7c72e44dc855d8ca5459a73b9 Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Mon, 15 Jun 2009 05:38:14 +0000 Subject: fix url in alert emails for alerts triggered by slaves --- lib/Smokeping.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index e09419a..990de60 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1807,10 +1807,9 @@ sub check_alerts { $line =~ s|^$base/||; $line =~ s|/host$||; $line =~ s|/|.|g; + my $urlline = $cfg->{General}{cgiurl}."?target=".$line; $line .= "[from $slave]" if $slave; - do_log("Alert $_ $what for $line"); - my $urlline = $line; - $urlline = $cfg->{General}{cgiurl}."?target=".$line; + do_log("Alert $_ $what for $line"); my $loss = "loss: ".join ", ",map {defined $_ ? (/^\d/ ? sprintf "%.0f%%", $_ :$_):"U" } @{$x->{loss}}; my $rtt = "rtt: ".join ", ",map {defined $_ ? (/^\d/ ? sprintf "%.0fms", $_*1000 :$_):"U" } @{$x->{rtt}}; my $time = time; -- cgit v1.2.3-24-g4f1b