summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2009-06-15 07:38:14 +0200
committerTobi Oetiker <tobi@oetiker.ch>2009-06-15 07:38:14 +0200
commit80c593387051f0a7c72e44dc855d8ca5459a73b9 (patch)
treedf443544fd800eda663774a2296c639aeb3d07e3
parenta4b49e45557677dd854bc84cb38bed952fd9588d (diff)
downloadsmokeping-80c593387051f0a7c72e44dc855d8ca5459a73b9.tar.gz
smokeping-80c593387051f0a7c72e44dc855d8ca5459a73b9.tar.xz
fix url in alert emails for alerts triggered by slaves
-rw-r--r--CHANGES3
-rw-r--r--lib/Smokeping.pm5
2 files changed, 5 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index eea9142..cea0cd9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+* fixed url in alert messages triggered from slaves. as reported by Nathan
+ Long --tobi
+
* fix a typo in configuration example 4, spotted by Guglielmo Bondioni
<guglielmo.bondioni *gmail.com> --niko
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;