sensu-plugins-aws 6.1.1 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/bin/check-ec2-filter.rb +11 -0
- data/lib/sensu-plugins-aws/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2669e69fa48f61aad388fa5fdb1381d3bb1ce02
|
|
4
|
+
data.tar.gz: 96d69c067e204aaa554fd7125f2ec3e5c0eb69b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c85a02a3183f3ed5e25cd274eb207ba5402d9df11f3eecea790a07213f966c79cbb5838eb4ffcdd32fbb182ee9fb72a85b3c31bf684e0fb7673a16225006fac
|
|
7
|
+
data.tar.gz: f70380d502986f74acf2db395db32fe946f3f581a17fe3d0397346ea31eaf28c56e8d5a7e9d8dedf8f60dc6d02fb3af7752290cf2dcd9aeeccc3f6ab2bd51a67
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
## [6.2.0] 2017-07-07
|
|
9
|
+
### Added
|
|
10
|
+
- check-ec2-filter.rb: add --min-running-secs flag for specifying
|
|
11
|
+
minimum number of seconds an instance should be running before it is
|
|
12
|
+
included in the instance count. (@cwjohnston)
|
|
13
|
+
|
|
7
14
|
## [6.1.1] - 2017-07-07
|
|
8
15
|
### Added
|
|
9
16
|
- ruby 2.4 testing (@majormoses)
|
|
@@ -321,7 +328,8 @@ WARNING: This release contains major breaking changes that will impact all user
|
|
|
321
328
|
### Added
|
|
322
329
|
- initial release
|
|
323
330
|
|
|
324
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.
|
|
331
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.2.0...HEAD
|
|
332
|
+
[6.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.1.1...6.2.0
|
|
325
333
|
[6.1.1]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.1.0...6.1.1
|
|
326
334
|
[6.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.0.1...6.1.0
|
|
327
335
|
[6.0.1]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.0.0...6.0.1
|
data/bin/check-ec2-filter.rb
CHANGED
|
@@ -93,6 +93,10 @@ class EC2Filter < Sensu::Plugin::Check::CLI
|
|
|
93
93
|
boolean: true,
|
|
94
94
|
default: false
|
|
95
95
|
|
|
96
|
+
option :min_running_secs,
|
|
97
|
+
long: '--min-running-secs SECONDS',
|
|
98
|
+
default: nil
|
|
99
|
+
|
|
96
100
|
def aws_config
|
|
97
101
|
{ access_key_id: config[:aws_access_key],
|
|
98
102
|
secret_access_key: config[:aws_secret_access_key],
|
|
@@ -141,6 +145,7 @@ class EC2Filter < Sensu::Plugin::Check::CLI
|
|
|
141
145
|
r.instances.each do |i|
|
|
142
146
|
aws_instances << {
|
|
143
147
|
id: i[:instance_id],
|
|
148
|
+
launch_time: i.launch_time,
|
|
144
149
|
tags: i.tags
|
|
145
150
|
}
|
|
146
151
|
end
|
|
@@ -154,6 +159,12 @@ class EC2Filter < Sensu::Plugin::Check::CLI
|
|
|
154
159
|
end
|
|
155
160
|
end
|
|
156
161
|
|
|
162
|
+
unless config[:min_running_secs].nil?
|
|
163
|
+
aws_instances.delete_if do |instance|
|
|
164
|
+
(Time.now.utc - instance[:launch_time]).to_i < config[:min_running_secs].to_i
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
157
168
|
count = aws_instances.count
|
|
158
169
|
op = convert_operator
|
|
159
170
|
message = "Current count: #{count}"
|