aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notifiers/sms_aql.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-14 18:00:49 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-14 18:00:49 +0100
commit18b0906630ab4165d1e8b4bc66d7446b17c31605 (patch)
tree359b6018b6c7327d3c72c23516cd9378ce01a866 /lib/mauve/notifiers/sms_aql.rb
parent494b083408b354f38da9b1fc5e8ffb7238d009b3 (diff)
* Improved logging.
* Updated message suppression
Diffstat (limited to 'lib/mauve/notifiers/sms_aql.rb')
-rw-r--r--lib/mauve/notifiers/sms_aql.rb18
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/mauve/notifiers/sms_aql.rb b/lib/mauve/notifiers/sms_aql.rb
index dbda229..d0cf630 100644
--- a/lib/mauve/notifiers/sms_aql.rb
+++ b/lib/mauve/notifiers/sms_aql.rb
@@ -19,9 +19,9 @@ module Mauve
@name = name
end
- def send_alert(destination, alert, all_alerts, conditions = nil)
+ def send_alert(destination, alert, all_alerts, conditions = {})
uri = URI.parse(GATEWAY)
-
+
opts_string = {
:username => @username,
:password => @password,
@@ -52,17 +52,9 @@ module Mauve
end
protected
- def prepare_message(destination, alert, all_alerts, conditions=nil)
- if conditions
- @suppressed_changed = conditions[:suppressed_changed]
- end
-
- txt = case @suppressed_changed
- when true then "TOO MUCH NOISE! Last notification: "
- when false then "BACK TO NORMAL: "
- else
- ""
- end
+ def prepare_message(destination, alert, all_alerts, conditions={})
+ was_suppressed = conditions[:was_suppressed] || false
+ is_suppressed = conditions[:is_suppressed] || false
template_file = File.join(File.dirname(__FILE__),"templates","sms.txt.erb")