bin/handler-clockworksms.rb in sensu-plugins-clockworksms-0.0.3 vs bin/handler-clockworksms.rb in sensu-plugins-clockworksms-0.0.4

- old
+ new

@@ -11,14 +11,13 @@ # Released under the same terms as Sensu (the MIT license); see LICENSE # for details. require 'sensu-handler' require 'clockwork' -require 'timeout' # -# Clcokwork Sms Notify +# Clockwork SMS Notify # class ClockWorkSmsNotif < Sensu::Handler def event_name @event['client']['name'] + '/' + @event['check']['name'] end @@ -35,10 +34,10 @@ unless response.success # rubocop:disable GuardClause puts "#{response.error_code} - #{response.error_description}" end end - def handle # rubocop:disable all + def handle key = settings['clockworksms']['key'] to = settings['clockworksms']['to'] from = settings['clockworksms']['from'] || 'SENSU' fail 'Please define a valid SMS key' if key.nil?