From 19087662065bd48aa50d8e5acb1416e002dde393 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 26 Nov 2012 16:02:00 +0000 Subject: Updated so that each alert-type has its dedicated alert-target. --- lib/custodian/worker.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/custodian/worker.rb') diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb index 57c55f7..79dab1e 100644 --- a/lib/custodian/worker.rb +++ b/lib/custodian/worker.rb @@ -213,9 +213,14 @@ module Custodian # def do_raise( test ) @alerter.split( "," ).each do |alerter| + log_message( "Creating alerter: #{alerter}" ) alert = Custodian::AlertFactory.create( alerter, test ) - alert.set_target( Custodian::Settings.instance().alerter_target() ) + + target = Custodian::Settings.instance().alerter_target( alerter ) + puts "Target for alert is #{target}" + + alert.set_target( target ) alert.raise() end end @@ -228,7 +233,11 @@ module Custodian @alerter.split( "," ).each do |alerter| log_message( "Creating alerter: #{alerter}" ) alert = Custodian::AlertFactory.create( alerter, test ) - alert.set_target( Custodian::Settings.instance().alerter_target() ) + + target = Custodian::Settings.instance().alerter_target( alerter ) + puts "Target for alert is #{target}" + + alert.set_target( target ) alert.clear() end end -- cgit v1.2.1