diff options
author | Niko Tyni <ntyni@iki.fi> | 2006-07-12 19:32:39 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2006-07-12 19:32:39 +0200 |
commit | 8e6a401ce24a3c479bc2f24fe0f594b44d8aba1f (patch) | |
tree | bc70ad771d7e797462bd8be7401b2f28d927cc19 /lib/Smokeping/matchers/base.pm | |
parent | d1830b25c0f16ffe684b75ce0c5e4bd2b3f552bb (diff) | |
download | smokeping-8e6a401ce24a3c479bc2f24fe0f594b44d8aba1f.tar.gz smokeping-8e6a401ce24a3c479bc2f24fe0f594b44d8aba1f.tar.xz |
* pass 'prevmatch' to alert matcher plugins.
-- niko, from Dylan Vanderhoof <DylanV *semaphore.com>
(add to trunk as well)
Diffstat (limited to 'lib/Smokeping/matchers/base.pm')
-rw-r--r-- | lib/Smokeping/matchers/base.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Smokeping/matchers/base.pm b/lib/Smokeping/matchers/base.pm index 130634f..0d69bcd 100644 --- a/lib/Smokeping/matchers/base.pm +++ b/lib/Smokeping/matchers/base.pm @@ -80,7 +80,7 @@ sub Desc ($) { =head2 Test Run the matcher and return true or false. The Test method is called -with a hash of two arrays giving it access to both rtt and loss values. +with a hash containing two arrays giving it access to both rtt and loss values. my $data=shift; my @rtt = @{$data->{rtt}}; @@ -93,6 +93,11 @@ The arrays are ordered from old to new. There may be more than the expected number of elements in this array. Address them with $x[-1] to $x[-max]. +There's also a key called 'prevmatch' in the hash. It contains the +value returned by the previous call of the 'Test' method. This allows +for somewhat more intelligent alerting due to state awareness. + + my $prevmatch = $data->{prevmatch}; =cut |