From e93ef91dd711add857d40153cbd6293cf1a993be Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Sat, 24 Nov 2012 16:15:01 +0000 Subject: Add accessor, with sane defaults, for the alerters --- lib/custodian/settings.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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 -- cgit v1.2.1