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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deda2bd39a86f8e6c57041c434f79e37a6b9c2e4
4
- data.tar.gz: 95bdde270de14b069be0dd17e49a5285daba775e
3
+ metadata.gz: a2669e69fa48f61aad388fa5fdb1381d3bb1ce02
4
+ data.tar.gz: 96d69c067e204aaa554fd7125f2ec3e5c0eb69b4
5
5
  SHA512:
6
- metadata.gz: 9c85225a0ea700839cad7c7e0afd6406392ad7e1634b3e589d6bc68fc6995e7120b5661734db2b5ccb8075a4c92255f99802be39acffcaa6618ea023df4d609c
7
- data.tar.gz: ff38dc81f8104b832426203ba93a537871e8a577941195e1eace8442d5fac9a12db713b3178521951844dbece9f95782833d33d755f51cdcb722586ac9ec90ba
6
+ metadata.gz: 1c85a02a3183f3ed5e25cd274eb207ba5402d9df11f3eecea790a07213f966c79cbb5838eb4ffcdd32fbb182ee9fb72a85b3c31bf684e0fb7673a16225006fac
7
+ data.tar.gz: f70380d502986f74acf2db395db32fe946f3f581a17fe3d0397346ea31eaf28c56e8d5a7e9d8dedf8f60dc6d02fb3af7752290cf2dcd9aeeccc3f6ab2bd51a67
@@ -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.1.1...HEAD
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
@@ -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}"
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 6
4
- MINOR = 1
5
- PATCH = 1
4
+ MINOR = 2
5
+ PATCH = 0
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors