sensu-plugins-aws 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +21 -1
- data/README.md +23 -14
- data/bin/check-autoscaling-cpucredits.rb +161 -0
- data/bin/check-dynamodb-capacity.rb +22 -20
- data/bin/check-dynamodb-throttle.rb +22 -20
- data/bin/check-ec2-network.rb +23 -23
- data/bin/check-elb-certs.rb +12 -15
- data/bin/check-elb-health-fog.rb +11 -14
- data/bin/check-elb-health-sdk.rb +12 -14
- data/bin/check-elb-health.rb +6 -9
- data/bin/check-elb-latency.rb +23 -20
- data/bin/check-elb-nodes.rb +12 -11
- data/bin/check-elb-sum-requests.rb +22 -19
- data/bin/check-instance-events.rb +35 -36
- data/bin/check-rds-events.rb +31 -23
- data/bin/check-rds.rb +38 -25
- data/bin/check-redshift-events.rb +16 -12
- data/bin/check-ses-limit.rb +16 -10
- data/bin/check-sqs-messages.rb +13 -12
- data/bin/handler-ec2_node.rb +60 -37
- data/bin/{autoscaling-instance-count-metrics.rb → metrics-autoscaling-instance-count.rb} +12 -12
- data/bin/metrics-ec2-count.rb +64 -62
- data/bin/metrics-elasticache.rb +13 -12
- data/bin/metrics-elb-full.rb +17 -15
- data/bin/metrics-elb.rb +9 -8
- data/bin/metrics-sqs.rb +16 -11
- data/lib/sensu-plugins-aws/version.rb +2 -2
- metadata +14 -14
- metadata.gz.sig +0 -0
- data/bin/handler-ec2-node.rb +0 -156
data/bin/check-elb-certs.rb
CHANGED
@@ -13,10 +13,8 @@
|
|
13
13
|
# Linux
|
14
14
|
#
|
15
15
|
# DEPENDENCIES:
|
16
|
-
# gem: aws-sdk
|
16
|
+
# gem: aws-sdk-v1
|
17
17
|
# gem: sensu-plugin
|
18
|
-
# gem: openssl
|
19
|
-
# gem: net/http
|
20
18
|
#
|
21
19
|
# USAGE:
|
22
20
|
# ./check-ec2-network.rb -r ${you_region} -i ${your_instance_id} --warning-over 1000000 --critical-over 1500000
|
@@ -40,19 +38,19 @@ class CheckELBCerts < Sensu::Plugin::Check::CLI
|
|
40
38
|
option :aws_access_key,
|
41
39
|
short: '-a AWS_ACCESS_KEY',
|
42
40
|
long: '--aws-access-key AWS_ACCESS_KEY',
|
43
|
-
description: "AWS Access Key. Either set ENV['
|
44
|
-
default: ENV['
|
41
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
42
|
+
default: ENV['AWS_ACCESS_KEY']
|
45
43
|
|
46
44
|
option :aws_secret_access_key,
|
47
|
-
short: '-
|
48
|
-
long: '--aws-secret-access-key
|
49
|
-
description: "AWS Secret Access Key. Either set ENV['
|
50
|
-
default: ENV['
|
45
|
+
short: '-k AWS_SECRET_KEY',
|
46
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
47
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
48
|
+
default: ENV['AWS_SECRET_KEY']
|
51
49
|
|
52
50
|
option :aws_region,
|
53
51
|
short: '-r AWS_REGION',
|
54
52
|
long: '--aws-region REGION',
|
55
|
-
description: 'AWS Region (
|
53
|
+
description: 'AWS Region (defaults to us-east-1).',
|
56
54
|
default: 'us-east-1'
|
57
55
|
|
58
56
|
option :warn_under,
|
@@ -82,11 +80,10 @@ class CheckELBCerts < Sensu::Plugin::Check::CLI
|
|
82
80
|
end
|
83
81
|
|
84
82
|
def aws_config
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
hash
|
83
|
+
{ access_key_id: config[:aws_access_key],
|
84
|
+
secret_access_key: config[:aws_secret_access_key],
|
85
|
+
region: config[:aws_region]
|
86
|
+
}
|
90
87
|
end
|
91
88
|
|
92
89
|
def run # rubocop:disable all
|
data/bin/check-elb-health-fog.rb
CHANGED
@@ -15,7 +15,6 @@
|
|
15
15
|
# DEPENDENCIES:
|
16
16
|
# gem: fog
|
17
17
|
# gem: sensu-plugin
|
18
|
-
# gem: uri
|
19
18
|
#
|
20
19
|
# USAGE:
|
21
20
|
# ./check-ec2-network.rb -r ${you_region} -i ${your_instance_id} --warning-over 1000000 --critical-over 1500000
|
@@ -39,16 +38,14 @@ class ELBHealth < Sensu::Plugin::Check::CLI
|
|
39
38
|
option :aws_access_key,
|
40
39
|
short: '-a AWS_ACCESS_KEY',
|
41
40
|
long: '--aws-access-key AWS_ACCESS_KEY',
|
42
|
-
description: "AWS Access Key. Either set ENV['
|
43
|
-
|
44
|
-
default: ENV['AWS_ACCESS_KEY_ID']
|
41
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
42
|
+
default: ENV['AWS_ACCESS_KEY']
|
45
43
|
|
46
44
|
option :aws_secret_access_key,
|
47
|
-
short: '-
|
48
|
-
long: '--aws-secret-access-key
|
49
|
-
description: "AWS Secret Access Key. Either set ENV['
|
50
|
-
|
51
|
-
default: ENV['AWS_SECRET_ACCESS_KEY']
|
45
|
+
short: '-k AWS_SECRET_KEY',
|
46
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
47
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
48
|
+
default: ENV['AWS_SECRET_KEY']
|
52
49
|
|
53
50
|
option :aws_region,
|
54
51
|
short: '-r AWS_REGION',
|
@@ -84,10 +81,10 @@ class ELBHealth < Sensu::Plugin::Check::CLI
|
|
84
81
|
end
|
85
82
|
|
86
83
|
def aws_config
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
84
|
+
{ access_key_id: config[:aws_access_key],
|
85
|
+
secret_access_key: config[:aws_secret_access_key],
|
86
|
+
region: config[:aws_region]
|
87
|
+
}
|
91
88
|
end
|
92
89
|
|
93
90
|
def run
|
@@ -108,7 +105,7 @@ class ELBHealth < Sensu::Plugin::Check::CLI
|
|
108
105
|
ok "All instances on ELB #{aws_region}::#{config[:elb_name]} healthy!"
|
109
106
|
else
|
110
107
|
if config[:verbose]
|
111
|
-
critical "Unhealthy instances detected: #{unhealthy_instances.map { |id, state| '[' + id + '::' + state + ']' }.join(' ')
|
108
|
+
critical "Unhealthy instances detected: #{unhealthy_instances.map { |id, state| '[' + id + '::' + state + ']' }.join(' ')}"
|
112
109
|
else
|
113
110
|
critical "Detected [#{unhealthy_instances.size}] unhealthy instances"
|
114
111
|
end
|
data/bin/check-elb-health-sdk.rb
CHANGED
@@ -14,9 +14,7 @@
|
|
14
14
|
# Linux
|
15
15
|
#
|
16
16
|
# DEPENDENCIES:
|
17
|
-
# gem: aws-sdk
|
18
|
-
# gem: uri
|
19
|
-
# gem: net/http
|
17
|
+
# gem: aws-sdk-v1
|
20
18
|
# gem: sensu-plugin
|
21
19
|
#
|
22
20
|
# Copyright (c) 2015, Benjamin Kett <bkett@umn.edu>
|
@@ -33,19 +31,19 @@ class ELBHealth < Sensu::Plugin::Check::CLI
|
|
33
31
|
option :aws_access_key,
|
34
32
|
short: '-a AWS_ACCESS_KEY',
|
35
33
|
long: '--aws-access-key AWS_ACCESS_KEY',
|
36
|
-
description: "AWS Access Key. Either set ENV['
|
37
|
-
default: ENV['
|
34
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
35
|
+
default: ENV['AWS_ACCESS_KEY']
|
38
36
|
|
39
37
|
option :aws_secret_access_key,
|
40
|
-
short: '-
|
41
|
-
long: '--aws-secret-access-key
|
42
|
-
description: "AWS Secret Access Key. Either set ENV['
|
43
|
-
default: ENV['
|
38
|
+
short: '-k AWS_SECRET_KEY',
|
39
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
40
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
41
|
+
default: ENV['AWS_SECRET_KEY']
|
44
42
|
|
45
43
|
option :aws_region,
|
46
44
|
short: '-r AWS_REGION',
|
47
45
|
long: '--aws-region REGION',
|
48
|
-
description: 'AWS Region (
|
46
|
+
description: 'AWS Region (defaults to us-east-1).',
|
49
47
|
default: 'us-east-1'
|
50
48
|
|
51
49
|
option :elb_name,
|
@@ -66,10 +64,10 @@ class ELBHealth < Sensu::Plugin::Check::CLI
|
|
66
64
|
default: false
|
67
65
|
|
68
66
|
def aws_config
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
67
|
+
{ access_key_id: config[:aws_access_key],
|
68
|
+
secret_access_key: config[:aws_secret_access_key],
|
69
|
+
region: config[:aws_region]
|
70
|
+
}
|
73
71
|
end
|
74
72
|
|
75
73
|
def elb
|
data/bin/check-elb-health.rb
CHANGED
@@ -13,7 +13,6 @@
|
|
13
13
|
#
|
14
14
|
# DEPENDENCIES:
|
15
15
|
# gem: right-aws
|
16
|
-
# gem: uri
|
17
16
|
# gem: sensu-plugin
|
18
17
|
#
|
19
18
|
# USAGE:
|
@@ -38,16 +37,14 @@ class ELBHealth < Sensu::Plugin::Check::CLI
|
|
38
37
|
option :aws_access_key,
|
39
38
|
short: '-a AWS_ACCESS_KEY',
|
40
39
|
long: '--aws-access-key AWS_ACCESS_KEY',
|
41
|
-
description: "AWS Access Key. Either set ENV['
|
42
|
-
|
43
|
-
default: ENV['AWS_ACCESS_KEY_ID']
|
40
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
41
|
+
default: ENV['AWS_ACCESS_KEY']
|
44
42
|
|
45
43
|
option :aws_secret_access_key,
|
46
|
-
short: '-
|
47
|
-
long: '--aws-secret-access-key
|
48
|
-
description: "AWS Secret Access Key. Either set ENV['
|
49
|
-
|
50
|
-
default: ENV['AWS_SECRET_ACCESS_KEY']
|
44
|
+
short: '-k AWS_SECRET_KEY',
|
45
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
46
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
47
|
+
default: ENV['AWS_SECRET_KEY']
|
51
48
|
|
52
49
|
option :aws_region,
|
53
50
|
short: '-r AWS_REGION',
|
data/bin/check-elb-latency.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
# Linux
|
14
14
|
#
|
15
15
|
# DEPENDENCIES:
|
16
|
-
# gem: aws-sdk
|
16
|
+
# gem: aws-sdk-v1
|
17
17
|
# gem: sensu-plugin
|
18
18
|
#
|
19
19
|
# USAGE:
|
@@ -35,20 +35,23 @@ require 'sensu-plugin/check/cli'
|
|
35
35
|
require 'aws-sdk-v1'
|
36
36
|
|
37
37
|
class CheckELBLatency < Sensu::Plugin::Check::CLI
|
38
|
-
option :
|
39
|
-
short: '-
|
40
|
-
long: '--access-key
|
41
|
-
description:
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
38
|
+
option :aws_access_key,
|
39
|
+
short: '-a AWS_ACCESS_KEY',
|
40
|
+
long: '--aws-access-key AWS_ACCESS_KEY',
|
41
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
42
|
+
default: ENV['AWS_ACCESS_KEY']
|
43
|
+
|
44
|
+
option :aws_secret_access_key,
|
45
|
+
short: '-k AWS_SECRET_KEY',
|
46
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
47
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
48
|
+
default: ENV['AWS_SECRET_KEY']
|
49
|
+
|
50
|
+
option :aws_region,
|
51
|
+
short: '-r AWS_REGION',
|
52
|
+
long: '--aws-region REGION',
|
53
|
+
description: 'AWS Region (defaults to us-east-1).',
|
54
|
+
default: 'us-east-1'
|
52
55
|
|
53
56
|
option :elb_names,
|
54
57
|
short: '-l N',
|
@@ -85,10 +88,10 @@ class CheckELBLatency < Sensu::Plugin::Check::CLI
|
|
85
88
|
end
|
86
89
|
|
87
90
|
def aws_config
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
91
|
+
{ access_key_id: config[:aws_access_key],
|
92
|
+
secret_access_key: config[:aws_secret_access_key],
|
93
|
+
region: config[:aws_region]
|
94
|
+
}
|
92
95
|
end
|
93
96
|
|
94
97
|
def elb
|
@@ -141,7 +144,7 @@ class CheckELBLatency < Sensu::Plugin::Check::CLI
|
|
141
144
|
next unless threshold
|
142
145
|
next if metric_value < threshold
|
143
146
|
flag_alert severity,
|
144
|
-
"; #{elbs.size == 1 ? nil : "#{elb.inspect}'s"} Latency is #{sprintf '%.3f', metric_value} seconds. (expected lower than #{sprintf '%.3f', threshold})"
|
147
|
+
"; #{elbs.size == 1 ? nil : "#{elb.inspect}'s"} Latency is #{sprintf '%.3f', metric_value} seconds. (expected lower than #{sprintf '%.3f', threshold})" # rubocop:disable all
|
145
148
|
break
|
146
149
|
end
|
147
150
|
end
|
data/bin/check-elb-nodes.rb
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
# Linux
|
14
14
|
#
|
15
15
|
# DEPENDENCIES:
|
16
|
-
# gem: aws-sdk
|
16
|
+
# gem: aws-sdk-v1
|
17
17
|
# gem: sensu-plugin
|
18
18
|
#
|
19
19
|
# USAGE:
|
@@ -38,17 +38,19 @@ class CheckELBNodes < Sensu::Plugin::Check::CLI
|
|
38
38
|
option :aws_access_key,
|
39
39
|
short: '-a AWS_ACCESS_KEY',
|
40
40
|
long: '--aws-access-key AWS_ACCESS_KEY',
|
41
|
-
description: "AWS Access Key. Either set ENV['
|
41
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
42
|
+
default: ENV['AWS_ACCESS_KEY']
|
42
43
|
|
43
44
|
option :aws_secret_access_key,
|
44
|
-
short: '-
|
45
|
-
long: '--aws-secret-access-key
|
46
|
-
description: "AWS Secret Access Key. Either set ENV['
|
45
|
+
short: '-k AWS_SECRET_KEY',
|
46
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
47
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
48
|
+
default: ENV['AWS_SECRET_KEY']
|
47
49
|
|
48
50
|
option :aws_region,
|
49
51
|
short: '-r AWS_REGION',
|
50
52
|
long: '--aws-region REGION',
|
51
|
-
description: 'AWS Region (
|
53
|
+
description: 'AWS Region (defaults to us-east-1).',
|
52
54
|
default: 'us-east-1'
|
53
55
|
|
54
56
|
option :load_balancer,
|
@@ -86,11 +88,10 @@ class CheckELBNodes < Sensu::Plugin::Check::CLI
|
|
86
88
|
proc: proc(&:to_i)
|
87
89
|
|
88
90
|
def aws_config
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
hash
|
91
|
+
{ access_key_id: config[:aws_access_key],
|
92
|
+
secret_access_key: config[:aws_secret_access_key],
|
93
|
+
region: config[:aws_region]
|
94
|
+
}
|
94
95
|
end
|
95
96
|
|
96
97
|
def run # rubocop:disable all
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# Linux
|
13
13
|
#
|
14
14
|
# DEPENDENCIES:
|
15
|
-
# gem: aws-sdk
|
15
|
+
# gem: aws-sdk-v1
|
16
16
|
# gem: sensu-plugin
|
17
17
|
#
|
18
18
|
# USAGE:
|
@@ -34,20 +34,23 @@ require 'sensu-plugin/check/cli'
|
|
34
34
|
require 'aws-sdk-v1'
|
35
35
|
|
36
36
|
class CheckELBSumRequests < Sensu::Plugin::Check::CLI
|
37
|
-
option :
|
38
|
-
short: '-
|
39
|
-
long: '--access-key
|
40
|
-
description:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
37
|
+
option :aws_access_key,
|
38
|
+
short: '-a AWS_ACCESS_KEY',
|
39
|
+
long: '--aws-access-key AWS_ACCESS_KEY',
|
40
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
41
|
+
default: ENV['AWS_ACCESS_KEY']
|
42
|
+
|
43
|
+
option :aws_secret_access_key,
|
44
|
+
short: '-k AWS_SECRET_KEY',
|
45
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
46
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
47
|
+
default: ENV['AWS_SECRET_KEY']
|
48
|
+
|
49
|
+
option :aws_region,
|
50
|
+
short: '-r AWS_REGION',
|
51
|
+
long: '--aws-region REGION',
|
52
|
+
description: 'AWS Region (defaults to us-east-1).',
|
53
|
+
default: 'us-east-1'
|
51
54
|
|
52
55
|
option :elb_names,
|
53
56
|
short: '-l N',
|
@@ -77,10 +80,10 @@ class CheckELBSumRequests < Sensu::Plugin::Check::CLI
|
|
77
80
|
end
|
78
81
|
|
79
82
|
def aws_config
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
{ access_key_id: config[:aws_access_key],
|
84
|
+
secret_access_key: config[:aws_secret_access_key],
|
85
|
+
region: config[:aws_region]
|
86
|
+
}
|
84
87
|
end
|
85
88
|
|
86
89
|
def elb
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# Linux
|
14
14
|
#
|
15
15
|
# DEPENDENCIES:
|
16
|
-
# gem: aws-sdk
|
16
|
+
# gem: aws-sdk-v1
|
17
17
|
# gem: sensu-plugin
|
18
18
|
#
|
19
19
|
# USAGE:
|
@@ -34,8 +34,20 @@ class CheckInstanceEvents < Sensu::Plugin::Check::CLI
|
|
34
34
|
option :aws_access_key,
|
35
35
|
short: '-a AWS_ACCESS_KEY',
|
36
36
|
long: '--aws-access-key AWS_ACCESS_KEY',
|
37
|
-
description: "AWS Access Key. Either set ENV['
|
38
|
-
default: ENV['
|
37
|
+
description: "AWS Access Key. Either set ENV['AWS_ACCESS_KEY'] or provide it as an option",
|
38
|
+
default: ENV['AWS_ACCESS_KEY']
|
39
|
+
|
40
|
+
option :aws_secret_access_key,
|
41
|
+
short: '-k AWS_SECRET_KEY',
|
42
|
+
long: '--aws-secret-access-key AWS_SECRET_KEY',
|
43
|
+
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_KEY'] or provide it as an option",
|
44
|
+
default: ENV['AWS_SECRET_KEY']
|
45
|
+
|
46
|
+
option :aws_region,
|
47
|
+
short: '-r AWS_REGION',
|
48
|
+
long: '--aws-region REGION',
|
49
|
+
description: 'AWS Region (defaults to us-east-1).',
|
50
|
+
default: 'us-east-1'
|
39
51
|
|
40
52
|
option :use_iam_role,
|
41
53
|
short: '-u',
|
@@ -48,24 +60,11 @@ class CheckInstanceEvents < Sensu::Plugin::Check::CLI
|
|
48
60
|
description: "Includes any offending instance's 'Name' tag in the check output",
|
49
61
|
default: false
|
50
62
|
|
51
|
-
option :aws_secret_access_key,
|
52
|
-
short: '-s AWS_SECRET_ACCESS_KEY',
|
53
|
-
long: '--aws-secret-access-key AWS_SECRET_ACCESS_KEY',
|
54
|
-
description: "AWS Secret Access Key. Either set ENV['AWS_SECRET_ACCESS_KEY'] or provide it as an option",
|
55
|
-
default: ENV['AWS_SECRET_ACCESS_KEY']
|
56
|
-
|
57
|
-
option :aws_region,
|
58
|
-
short: '-r AWS_REGION',
|
59
|
-
long: '--aws-region REGION',
|
60
|
-
description: 'AWS Region (such as eu-west-1).',
|
61
|
-
default: 'us-east-1'
|
62
|
-
|
63
63
|
def aws_config
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
hash
|
64
|
+
{ access_key_id: config[:aws_access_key],
|
65
|
+
secret_access_key: config[:aws_secret_access_key],
|
66
|
+
region: config[:aws_region]
|
67
|
+
}
|
69
68
|
end
|
70
69
|
|
71
70
|
def run
|
@@ -81,22 +80,22 @@ class CheckInstanceEvents < Sensu::Plugin::Check::CLI
|
|
81
80
|
|
82
81
|
ec2 = AWS::EC2::Client.new(aws_config.merge!(region: config[:aws_region]))
|
83
82
|
begin
|
84
|
-
ec2.describe_instance_status[:instance_status_set].each do |i|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
83
|
+
ec2.describe_instance_status[:instance_status_set].each do |i|
|
84
|
+
next if i[:events_set].empty?
|
85
|
+
|
86
|
+
# Exclude completed reboots since the events API appearently returns these even after they have been completed:
|
87
|
+
# Example:
|
88
|
+
# "events_set": [
|
89
|
+
# {
|
90
|
+
# "code": "system-reboot",
|
91
|
+
# "description": "[Completed] Scheduled reboot",
|
92
|
+
# "not_before": "2015-01-05 12:00:00 UTC",
|
93
|
+
# "not_after": "2015-01-05 18:00:00 UTC"
|
94
|
+
# }
|
95
|
+
# ]
|
96
|
+
useful_events = i[:events_set].reject { |x| x[:code] == 'system-reboot' && x[:description] =~ /\[Completed\]/ }
|
97
|
+
unless useful_events.empty?
|
98
|
+
event_instances << i[:instance_id]
|
100
99
|
end
|
101
100
|
end
|
102
101
|
rescue => e
|