sensu-plugins-aws 18.0.0 → 18.1.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
  SHA256:
3
- metadata.gz: e2bfbea1a8179399b3af1904234acc10da66dadbd5bf9f76f28f8bd7a964d8ea
4
- data.tar.gz: 76db783d1869778c3b75bf50bfea4bd33fe1bff9900566cc389b91b4d5b7670a
3
+ metadata.gz: 54838ff66b0e5849220a8b08d1b76ec644b68407eca3d01b6bff2831023ccd7f
4
+ data.tar.gz: f11e57b9e4a804fba44694711fc0985f18b00ba10e4350ed576b53490787f304
5
5
  SHA512:
6
- metadata.gz: 9fd7a0c73b8adc720758070d1d834ac82d56840957eb2b9e98ce2cbb997dee63a2781b02cdef074f7be28650d09573c1260ac1e240ac1d1dd350a181f69b4c1b
7
- data.tar.gz: c2010d4ad339a3d533b17c4a7708e0516db4a964e581de6fa0494328dd9405d80bc2b5f5e2e9dc0e89cf7bf5ff0c20646b1c188a42f03fdefce75212cf00ba47
6
+ metadata.gz: 353c9b344ed3940c55144ab907b987fc7c446810199a0ec9656f557d44d2a362c706d60112822afdcea5b3459d0fc839155f021d7244169b83845f0c5df8f967
7
+ data.tar.gz: 1d4ca6e7c132ae96d80935babfb02e9f4016586d01359ebf8ee550c2fcd5eabd44fa43561aa2a4a6a134f2d317acc5585fc9ffd47d72b19a8c5646ea91905256
data/CHANGELOG.md CHANGED
@@ -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.1.0] - 2019-05-06
9
+ ### Added
10
+ - `check-ec2-cpu_balance.rb`: `--filter` option added to filter which instance to check. (@boutetnico)
11
+
8
12
  ## [18.0.0] - 2019-04-2
9
13
  ### Breaking Changes
10
14
  - `check-alb-target-group-health.rb` will now alert if a n ALB has no health targets (@kunal-plivo)
@@ -570,7 +574,8 @@ WARNING: This release contains major breaking changes that will impact all user
570
574
  ### Added
571
575
  - initial release
572
576
 
573
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.0.0...HEAD
577
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.1.0...HEAD
578
+ [18.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.0.0...18.1.0
574
579
  [18.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.2.0...18.0.0
575
580
  [17.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.1.0...17.2.0
576
581
  [17.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.0.0...17.1.0
@@ -19,6 +19,7 @@
19
19
  # ./check-ec2-cpu_balance -c 20
20
20
  # ./check-ec2-cpu_balance -w 25 -c 20
21
21
  # ./check-ec2-cpu_balance -c 20 -t 'Name'
22
+ # ./check-ec2-cpu_balance -c 20 -t 'Name' -F "{name:tag-value,values:[infrastructure]}"
22
23
  #
23
24
  # NOTES:
24
25
  #
@@ -31,9 +32,11 @@
31
32
  require 'sensu-plugins-aws'
32
33
  require 'sensu-plugin/check/cli'
33
34
  require 'aws-sdk'
35
+ require 'sensu-plugins-aws/filter'
34
36
 
35
37
  class EC2CpuBalance < Sensu::Plugin::Check::CLI
36
38
  include Common
39
+ include Filter
37
40
 
38
41
  option :critical,
39
42
  description: 'Trigger a critical when value is below VALUE',
@@ -66,6 +69,12 @@ class EC2CpuBalance < Sensu::Plugin::Check::CLI
66
69
  proc: proc { |x| x.split(',') },
67
70
  default: %w[t2 t3]
68
71
 
72
+ option :filter,
73
+ short: '-F FILTER',
74
+ long: '--filter FILTER',
75
+ description: 'String representation of the filter to apply',
76
+ default: '{}'
77
+
69
78
  def data(instance)
70
79
  client = Aws::CloudWatch::Client.new
71
80
  stats = 'Average'
@@ -94,14 +103,14 @@ class EC2CpuBalance < Sensu::Plugin::Check::CLI
94
103
  end
95
104
 
96
105
  def run
106
+ filters = Filter.parse(config[:filter])
107
+ filters.push(
108
+ name: 'instance-state-name',
109
+ values: ['running']
110
+ )
97
111
  ec2 = Aws::EC2::Client.new
98
112
  instances = ec2.describe_instances(
99
- filters: [
100
- {
101
- name: 'instance-state-name',
102
- values: ['running']
103
- }
104
- ]
113
+ filters: filters
105
114
  )
106
115
 
107
116
  messages = "\n"
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 18
4
- MINOR = 0
4
+ MINOR = 1
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.0.0
4
+ version: 18.1.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-04-03 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin