bin/check-instance-events.rb in sensu-plugins-aws-0.0.1.alpha.2 vs bin/check-instance-events.rb in sensu-plugins-aws-0.0.1
- old
+ new
@@ -25,11 +25,10 @@
# Copyright (c) 2014, Tim Smith, tim@cozy.co
# Released under the same terms as Sensu (the MIT license); see LICENSE
# for details.
#
-require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-plugin/check/cli'
require 'aws-sdk'
class CheckInstanceEvents < Sensu::Plugin::Check::CLI
option :aws_access_key,
@@ -73,18 +72,17 @@
event_instances = []
aws_config = {}
if config[:use_iam_role].nil?
aws_config.merge!(
- access_key_id: config[:aws_access_key],
- secret_access_key: config[:aws_secret_access_key]
+ access_key_id: config[:aws_access_key],
+ secret_access_key: config[:aws_secret_access_key]
)
end
ec2 = AWS::EC2::Client.new(aws_config.merge!(region: config[:aws_region]))
begin
ec2.describe_instance_status[:instance_status_set].each do |i| # rubocop:disable Next
-
unless i[:events_set].empty?
# Exclude completed reboots since the events API appearently returns these even after they have been completed:
# Example:
# "events_set": [
# {