diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-24 16:15:01 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-24 16:15:01 +0000 |
commit | e93ef91dd711add857d40153cbd6293cf1a993be (patch) | |
tree | e3c6b198a026ff0748701f23f299e69458d15d16 /lib/custodian/settings.rb | |
parent | 33255c3343aa8914627d8a54391c3a862f32fb29 (diff) |
Add accessor, with sane defaults, for the alerters
Diffstat (limited to 'lib/custodian/settings.rb')
-rw-r--r-- | lib/custodian/settings.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/custodian/settings.rb b/lib/custodian/settings.rb index 09bf043..7d854f1 100644 --- a/lib/custodian/settings.rb +++ b/lib/custodian/settings.rb @@ -116,5 +116,35 @@ module Custodian end + # + # The target for the alert. + # + # When the alerter is "file" the target is the mail address. + # + # When the alerter is "file" the target is the logfile. + # + # When the alerter is "mauve" the target is the destination for the + # alerts. + # + def alerter_target + _load() unless( _loaded? ) + + if ( @settings['alerter_target'] ) + return( @settings['alerter_target'] ) + end + + case alerter() + when "smtp": + "root" + when "mauve": + "alert.bytemark.co.uk" + when "file": + "alerts.log" + else + nil + end + end + + end end |