aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notifiers
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-06-17 09:09:10 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-06-17 09:09:10 +0100
commit0dcb2755a2a68d447c8faf673db3bbe73caa12a8 (patch)
tree19d04981abfb4160f383212d7ed957aea456ddcb /lib/mauve/notifiers
parentc50972e379859bffc30f8676192986e28840b107 (diff)
Updated sms notifier.
Diffstat (limited to 'lib/mauve/notifiers')
-rw-r--r--lib/mauve/notifiers/sms_aql.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/mauve/notifiers/sms_aql.rb b/lib/mauve/notifiers/sms_aql.rb
index 1cf8c04..c1c356b 100644
--- a/lib/mauve/notifiers/sms_aql.rb
+++ b/lib/mauve/notifiers/sms_aql.rb
@@ -57,9 +57,15 @@ module Mauve
""
end
- txt += "#{alert.update_type.upcase}: "
- txt += alert.summary_one_line
-
+ template_file = File.join(File.dirname(__FILE__),"templates","sms.txt.erb")
+
+ txt += if File.exists?(template_file)
+ ERB.new(File.read(template_file)).result(binding).chomp
+ else
+ logger.error("Could not find sms.txt.erb template")
+ alert.to_s
+ end
+
others = all_alerts-[alert]
if !others.empty?
txt += (1 == others.length)?