sensu-plugins-aws 18.3.0 → 18.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb986d62da220b60b0f2e66794be82bbbf685320d42e7f126d1454e672ee7915
4
- data.tar.gz: 1c3b455fb96f1d194af0a12693fc6ecd127114379eb14bd88352f6aad5bcbc8c
3
+ metadata.gz: f12454344d3fbd7fbe16276a393b9ef35226b15dd3cb106ad030ad8483c2fd06
4
+ data.tar.gz: c4a254f9cf57636d778f27a0596d81456e34d72b908a23931cd023694f68597b
5
5
  SHA512:
6
- metadata.gz: b6ebc68a7983287cc91e5411cb70e589500880e9a5181259bcf4b1ee63520d666eb357b286eed8ce91b4953c8671b21cc8b0ecc934ac6575f85b968e51dde279
7
- data.tar.gz: d45fe80f8643a31112732663e58048e0947d2a95883cf9f37d97f19009a9a66ea27a139c616825c87b4e8844ff5196f39f00beac13d8b76df9998addea08527b
6
+ metadata.gz: 21189fd4873394a4a558123e84facd79d3db28fa79fc915a814bdff2ab3771cbf8e1ef6219373bf3fca338d833674ed8b356356c1a6aed9711bddb574aadb44d
7
+ data.tar.gz: 44c7207c81a1686bc99b604cf9479a1c3cca3535844f04ba84884c1a89ba3eb06d35e370d2c14316eaaa4cb404e50553b68e1128d5eddfbd548eb302eea13aae
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [18.4.0] - 2019-05-08
9
+ ### Added
10
+ - `check-ebs-burst-limit.rb`: `--filter` option added to filter which volume to check. (@boutetnico)
11
+
8
12
  ## [18.3.0] - 2019-05-07
9
13
  ### Added
10
14
  - Travis build automation to generate Sensu Asset tarballs that can be used in conjunction with Sensu provided ruby runtime assets and the Bonsai Asset Index
@@ -582,7 +586,8 @@ WARNING: This release contains major breaking changes that will impact all user
582
586
  ### Added
583
587
  - initial release
584
588
 
585
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.3.0...HEAD
589
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.4.0...HEAD
590
+ [18.4.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.3.0...18.4.0
586
591
  [18.3.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.2.0...18.3.0
587
592
  [18.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.1.0...18.2.0
588
593
  [18.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.0.0...18.1.0
@@ -20,6 +20,7 @@
20
20
  # ./check-ebs-burst-limit.rb -r ${you_region}
21
21
  # ./check-ebs-burst-limit.rb -r ${you_region} -c 50
22
22
  # ./check-ebs-burst-limit.rb -r ${you_region} -w 50 -c 10
23
+ # ./check-ebs-burst-limit.rb -r ${you_region} -w 50 -c 10 -f "{name:tag-value,values:[infrastructure]}"
23
24
  #
24
25
  # LICENSE:
25
26
  # Barry Martin <nyxcharon@gmail.com>
@@ -29,11 +30,13 @@
29
30
 
30
31
  require 'sensu-plugin/check/cli'
31
32
  require 'sensu-plugins-aws'
33
+ require 'sensu-plugins-aws/filter'
32
34
  require 'aws-sdk'
33
35
  require 'net/http'
34
36
 
35
37
  class CheckEbsBurstLimit < Sensu::Plugin::Check::CLI
36
38
  include CloudwatchCommon
39
+ include Filter
37
40
 
38
41
  option :aws_region,
39
42
  short: '-r R',
@@ -61,29 +64,33 @@ class CheckEbsBurstLimit < Sensu::Plugin::Check::CLI
61
64
  boolean: true,
62
65
  default: false
63
66
 
67
+ option :filter,
68
+ short: '-f FILTER',
69
+ long: '--filter FILTER',
70
+ description: 'String representation of the filter to apply',
71
+ default: '{}'
72
+
64
73
  def run
65
74
  errors = []
66
75
 
76
+ volume_filters = Filter.parse(config[:filter])
77
+
67
78
  # Set the describe-volumes filter depending on whether -s was specified
68
79
  if config[:check_self] == true
69
80
  # Get the region from the availability zone, and override the -r option
70
81
  my_instance_az = Net::HTTP.get(URI.parse('http://169.254.169.254/latest/meta-data/placement/availability-zone'))
71
82
  Aws.config[:region] = my_instance_az.chop
72
83
  my_instance_id = Net::HTTP.get(URI.parse('http://169.254.169.254/latest/meta-data/instance-id'))
73
- volume_filters = [
74
- {
75
- name: 'attachment.instance-id',
76
- values: [my_instance_id]
77
- }
78
- ]
84
+ volume_filters.push(
85
+ name: 'attachment.instance-id',
86
+ values: [my_instance_id]
87
+ )
79
88
  else
80
89
  # The -s option was not specified, look at all volumes which are attached
81
- volume_filters = [
82
- {
83
- name: 'attachment.status',
84
- values: ['attached']
85
- }
86
- ]
90
+ volume_filters.push(
91
+ name: 'attachment.status',
92
+ values: ['attached']
93
+ )
87
94
  end
88
95
 
89
96
  ec2 = Aws::EC2::Client.new
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 18
4
- MINOR = 3
4
+ MINOR = 4
5
5
  PATCH = 0
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.3.0
4
+ version: 18.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin