aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/alert_group.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-12-04 14:08:22 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-12-04 14:08:22 +0000
commit145b3a64114e74844528071956355472408012ba (patch)
treea16aa7417087768e190901d37ad4af297d2577f2 /lib/mauve/alert_group.rb
parent01653303f63df05ca877a30255ff92b708cae977 (diff)
Fixed up alert notification suppression to notify when alerts get re-raised.
Diffstat (limited to 'lib/mauve/alert_group.rb')
-rw-r--r--lib/mauve/alert_group.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mauve/alert_group.rb b/lib/mauve/alert_group.rb
index 554c560..fe78ad9 100644
--- a/lib/mauve/alert_group.rb
+++ b/lib/mauve/alert_group.rb
@@ -171,9 +171,15 @@ module Mauve
this_reminder.level = level.to_s
this_reminder.at = at
+ #
+ # Set a reminder if
+ # * there was no existing reminder
+ # * the alert now is raised, but the reminder was set when the alert was cleared, or the alert was ack'd.
+ # * the alert now is cleared, but the reminder was set when the alert was raised/re-raised/ack'd
+ #
if this_reminder.update_type.nil? or
- (alert.raised? and this_reminder.update_type == "CLEARED") or
- (alert.cleared? and %w(RE-RAISED RAISED ACKNOWLEDGED).include?(this_reminder.update_type))
+ (alert.raised? and %w(cleared acknowledged).include?(this_reminder.update_type.to_s.downcase)) or
+ (alert.cleared? and %w(re-raised raised acknowledged).include?(this_reminder.update_type.to_s.downcase))
this_reminder.update_type = alert.update_type
this_reminder.remind_at = alert.suppress_until