diff options
author | Niko Tyni <ntyni@iki.fi> | 2006-07-09 10:06:42 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2006-07-09 10:06:42 +0200 |
commit | 24aad364c78d190bdb371d0f19295cbecfc04ecd (patch) | |
tree | e23a2ad04629e3b56a382fb350116d2c7fbc2289 | |
parent | bc44b6eb6edf099dbd8f2ba40ce7ed9e03462add (diff) | |
download | smokeping-24aad364c78d190bdb371d0f19295cbecfc04ecd.tar.gz smokeping-24aad364c78d190bdb371d0f19295cbecfc04ecd.tar.xz |
Merge a change from the 2.0 tree.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | lib/Smokeping.pm | 5 |
2 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,9 @@ * AnotherDNS.pm: added option 'require_answers' for testing recursive DNS servers. -- niko +* brought back the FPing.pm 'timeout' parameter, since it does something + after all. -- niko, requested by Peter Klausner <peter.klausner *gmail.com> +* fix running an external program on edge-triggered alerts. + -- niko, from Peter Klausner <peter.klausner *gmail.com> 2006/7/9 -- released version 20060709_trunk diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 0236772..557f506 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1169,10 +1169,11 @@ sub update_rrds($$$$$) { foreach my $addr (map {$_ ? (split /\s*,\s*/,$_) : ()} $cfg->{Alerts}{to},$tree->{alertee},$cfg->{Alerts}{$_}{to}){ next unless $addr; if ( $addr =~ /^\|(.+)/) { + my $cmd = $1; if ($edgetrigger) { - system $1,$_,$line,$loss,$rtt,$tree->{host}, ($what =~/raise/); + system $cmd,$_,$line,$loss,$rtt,$tree->{host}, ($what =~/raise/); } else { - system $1,$_,$line,$loss,$rtt,$tree->{host}; + system $cmd,$_,$line,$loss,$rtt,$tree->{host}; } } elsif ( $addr =~ /^snpp:(.+)/ ) { sendsnpp $1, <<SNPPALERT; |