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 | deb2a91a6d599adbea0cb60a9ede4666064442be (patch) | |
tree | e3c6b198a026ff0748701f23f299e69458d15d16 /lib | |
parent | 3eae7f048f8245095d21b904dbb5763789a11edc (diff) |
Add accessor, with sane defaults, for the alerters
Diffstat (limited to 'lib')
-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 |