diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-07-22 16:55:01 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-07-22 16:55:01 +0100 |
commit | fd23821950f0562a8995735105cd31fdc6d55933 (patch) | |
tree | 967df2f5647803a6c46f4d52003b2231c1de72cb /lib/mauve/notifiers/sms_aql.rb | |
parent | d3a3cfef9650b08f62db62bd7e86b673f9d77d0b (diff) |
* Rejigged configuration
* Added --test and --verbose flags for the server config
* Started proper test suite
* Config parsing now gives more sensible errors + backtrace
* Rejigged people and source lists
Diffstat (limited to 'lib/mauve/notifiers/sms_aql.rb')
-rw-r--r-- | lib/mauve/notifiers/sms_aql.rb | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/mauve/notifiers/sms_aql.rb b/lib/mauve/notifiers/sms_aql.rb index 9181be3..54a3104 100644 --- a/lib/mauve/notifiers/sms_aql.rb +++ b/lib/mauve/notifiers/sms_aql.rb @@ -6,13 +6,11 @@ module Mauve module Sms require 'net/https' + class AQL GATEWAY = "https://gw1.aql.com/sms/sms_gw.php" - attr :username, true - attr :password, true - attr :from, true - attr :max_messages_per_alert, true + attr_writer :username, :password, :from attr_reader :name def initialize(name) @@ -64,31 +62,11 @@ module Mauve logger.error("Could not find sms.txt.erb template") alert.to_s end - - others = all_alerts-[alert] - if !others.empty? - txt += (1 == others.length)? - "and a lone other." : - "and #{others.length} others." - #txt += "and #{others.length} others: " - #txt += others.map { |alert| alert.summary_one_line }.join(", ") - end - - # TODO: Fix link to be accurate. - # txt += "link: https://alert.bytemark.co.uk/alerts" - - ## @TODO: Add a link to acknowledge the alert in the text? - #txt += "Acknoweledge alert: "+ - # "https://alert.bytemark.co.uk/alert/acknowledge/"+ - # "#{alert.id}/#{alert.get_default_acknowledge_time} - - txt end def normalize_number(n) n.split("").select { |s| (?0..?9).include?(s[0]) }.join.gsub(/^0/, "44") end - include Debug end end end |