diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-26 16:02:00 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-26 16:02:00 +0000 |
commit | c61f9735c8b5be297c6114d8f2067adf42566b9e (patch) | |
tree | 928cb6e6a0aabe68b1567469103aadf6b07f6139 /lib/custodian/worker.rb | |
parent | ab883e6a1a17c014cd283d2a96d7a978d2330499 (diff) |
Updated so that each alert-type has its dedicated alert-target.
Diffstat (limited to 'lib/custodian/worker.rb')
-rw-r--r-- | lib/custodian/worker.rb | 13 |
1 files changed, 11 insertions, 2 deletions
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 |