bin/handler-opsgenie.rb in sensu-plugins-opsgenie-5.0.0 vs bin/handler-opsgenie.rb in sensu-plugins-opsgenie-5.1.0
- old
+ new
@@ -118,19 +118,26 @@
def client_name
@event['client']['name']
end
+ def details
+ details = {}
+ return @event['check']['opsgenie']['details'] unless @event['check']['opsgenie'].nil? || @event['check']['opsgenie']['details'].nil?
+ details
+ end
+
def create_alert
post_to_opsgenie(:create,
alias: event_id,
message: message,
description: description,
entity: client_name,
tags: tags,
recipients: json_config['recipients'],
- teams: json_config['teams'])
+ teams: json_config['teams'],
+ details: details)
end
def event_priority
return DEFAULT_PRIORITY unless json_config['priority']
priority = json_config['priority']
@@ -184,9 +191,10 @@
puts "Tags: #{params[:tags]}"
puts "Entity: #{params[:entity]}"
puts "Teams: #{params[:teams]}"
puts "Alias: #{params[:alias]}"
puts "Description: #{params[:description]}"
+ puts "Details: #{params[:details]}"
end
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE