bin/check-instance-events.rb in sensu-plugins-aws-3.0.0 vs bin/check-instance-events.rb in sensu-plugins-aws-3.1.0
- old
+ new
@@ -61,12 +61,11 @@
default: false
def aws_config
{ access_key_id: config[:aws_access_key],
secret_access_key: config[:aws_secret_access_key],
- region: config[:aws_region]
- }
+ region: config[:aws_region] }
end
def run
event_instances = []
aws_config = {}
@@ -89,10 +88,11 @@
# "description": "[Completed] Scheduled reboot",
# "not_before": "2015-01-05 12:00:00 UTC",
# "not_after": "2015-01-05 18:00:00 UTC"
# }
# ]
- useful_events = i[:events_set].reject { |x| x[:code] == 'system-reboot' && x[:description] =~ /\[Completed\]/ }
+ useful_events =
+ i[:events_set].reject { |x| (x[:code] == 'system-reboot' || x[:code] == 'instance-stop' || x[:code] == 'system-maintenance') && (x[:description] =~ /\[Completed\]/ || x[:description] =~ /\[Canceled\]/) }
unless useful_events.empty?
event_instances << i[:instance_id]
end
end
rescue => e