summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping.pm
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2006-07-12 19:32:39 +0200
committerNiko Tyni <ntyni@iki.fi>2006-07-12 19:32:39 +0200
commit8e6a401ce24a3c479bc2f24fe0f594b44d8aba1f (patch)
treebc70ad771d7e797462bd8be7401b2f28d927cc19 /lib/Smokeping.pm
parentd1830b25c0f16ffe684b75ce0c5e4bd2b3f552bb (diff)
downloadsmokeping-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.pm')
-rw-r--r--lib/Smokeping.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 49fdea8..9ff2578 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1142,6 +1142,12 @@ sub update_rrds($$$$$) {
next;
};
my $prevmatch = $tree->{prevmatch}{$_} || 0;
+
+ # add the current state of an edge triggered alert to the
+ # data passed into a matcher, which allows for somewhat
+ # more intelligent alerting due to state awareness.
+ $x->{prevmatch} = $prevmatch;
+
my $match = &{$cfg->{Alerts}{$_}{sub}}($x) || 0; # Avgratio returns undef
my $edgetrigger = $cfg->{Alerts}{$_}{edgetrigger} eq 'yes';
my $what;