sensu-plugins-aws 7.0.0 → 7.0.1

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
  SHA1:
3
- metadata.gz: bffcd26bc25e27f0c1e85fb9e6736aa748b7e573
4
- data.tar.gz: 4ab34c45151793a5a3b367f3325e69f38224fc7f
3
+ metadata.gz: 0e9b5f1eb3c12c84948ef04dfdccdfbf88fb8a87
4
+ data.tar.gz: cda4f9fef7a375bf9c55ace21b3b8bd006cbda5c
5
5
  SHA512:
6
- metadata.gz: 5484677c428d13c79b36b62f6bd86b42c4f50c66b7f24477c91fe6dabc6da67616e89cfc2f2dbdc13ca3dc24431aa6b7297bf2c8b4b4138165030826455657a3
7
- data.tar.gz: d673f2d9682d5d90af5e43702e116cd5e2c215104a042824c4e1ba277a3a2ba682b8807571ca77c8ea5ca295e531db55d4a331162c1165067ea862c52ba9971f
6
+ metadata.gz: f8cd56ed479d985a5d112b3f53fed0b19f8d4dd8c4fb0c8f84d0ea7853608c64e379e88f8d1cc0adfc73b8d1e599983f077cdbb8c6632a7160b2242b1e8c5b06
7
+ data.tar.gz: d18444784a229eabbeec567ac296181970d7c8243a517a6533840cfe49e6ded4abb761fe276a143711f6502aa321ea7e5bed4c326f98a6bfa72a9436a9652c64
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [7.0.1] - 2017-08-12
9
+ ### Fixed
10
+ - check-cloudwatch-metric.rb, check-cloudwatch-composite-metric.rb: fixed defaults to work (@majormoses)
11
+ - check-cloudwatch-metric.rb: short option `-n` was conflicting with `no_data_ok` and `namespace` as `check-cloudwatch-composite-metric.rb` uses `-O` I opted for that for consistency (@majormoses)
12
+
13
+ ### Changed
14
+ - check-cloudwatch-metric.rb, check-cloudwatch-composite-metric.rb: `self.parse_dimensions` and `dimension_string` were the same in both checks This fix was common mamong both checks so I moved it into the module
15
+
8
16
  ## [7.0.0] - 2017-08-07
9
17
  ### Breaking Change
10
18
  - Bump min dependency on `sensu-plugin` to 2.x (@huynt1979)
@@ -336,7 +344,8 @@ WARNING: This release contains major breaking changes that will impact all user
336
344
  ### Added
337
345
  - initial release
338
346
 
339
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/7.0.0...HEAD
347
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/7.0.1...HEAD
348
+ [7.0.1]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/7.0.0...7.0.1
340
349
  [7.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.3.0...7.0.0
341
350
  [6.3.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.2.0...6.3.0
342
351
  [6.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.1.1...6.2.0
@@ -63,8 +63,8 @@ class CloudWatchCompositeMetricCheck < Sensu::Plugin::Check::CLI
63
63
  description: 'Comma delimited list of DimName=Value',
64
64
  short: '-d DIMENSIONS',
65
65
  long: '--dimensions DIMENSIONS',
66
- proc: proc { |d| CloudWatchCompositeMetricCheck.parse_dimensions d },
67
- default: ''
66
+ proc: proc { |d| CloudwatchCommon.parse_dimensions d },
67
+ default: []
68
68
 
69
69
  option :period,
70
70
  description: 'CloudWatch metric statistics period. Must be a multiple of 60',
@@ -112,16 +112,6 @@ class CloudWatchCompositeMetricCheck < Sensu::Plugin::Check::CLI
112
112
 
113
113
  include CloudwatchCommon
114
114
 
115
- def self.parse_dimensions(dimension_string)
116
- dimension_string.split(',')
117
- .collect { |d| d.split '=' }
118
- .collect { |a| { name: a[0], value: a[1] } }
119
- end
120
-
121
- def dimension_string
122
- config[:dimensions].map { |d| "#{d[:name]}=#{d[:value]}" }.join('&')
123
- end
124
-
125
115
  def metric_desc
126
116
  "#{config[:namespace]}-#{config[:numerator_metric_name]}/#{config[:denominator_metric_name]}(#{dimension_string})"
127
117
  end
@@ -54,8 +54,8 @@ class CloudWatchMetricCheck < Sensu::Plugin::Check::CLI
54
54
  description: 'Comma delimited list of DimName=Value',
55
55
  short: '-d DIMENSIONS',
56
56
  long: '--dimensions DIMENSIONS',
57
- proc: proc { |d| CloudWatchMetricCheck.parse_dimensions d },
58
- default: ''
57
+ proc: proc { |d| CloudwatchCommon.parse_dimensions d },
58
+ default: []
59
59
 
60
60
  option :period,
61
61
  description: 'CloudWatch metric statistics period. Must be a multiple of 60',
@@ -95,7 +95,7 @@ class CloudWatchMetricCheck < Sensu::Plugin::Check::CLI
95
95
  default: 'greater'
96
96
 
97
97
  option :no_data_ok,
98
- short: '-n',
98
+ short: '-O',
99
99
  long: '--allow-no-data',
100
100
  description: 'Returns ok if no data is returned from the metric',
101
101
  boolean: true,
@@ -83,6 +83,16 @@ module CloudwatchCommon
83
83
  end
84
84
  end
85
85
 
86
+ def self.parse_dimensions(dimension_string)
87
+ dimension_string.split(',')
88
+ .collect { |d| d.split '=' }
89
+ .collect { |a| { name: a[0], value: a[1] } }
90
+ end
91
+
92
+ def dimension_string
93
+ config[:dimensions].map { |d| "#{d[:name]}=#{d[:value]}" }.join('&')
94
+ end
95
+
86
96
  def check(config)
87
97
  resp = client.get_metric_statistics(metrics_request(config))
88
98
 
@@ -2,7 +2,7 @@ module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 7
4
4
  MINOR = 0
5
- PATCH = 0
5
+ PATCH = 1
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
8
8
  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: 7.0.0
4
+ version: 7.0.1
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: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk