sensu-plugins-aws 6.2.0 → 6.3.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
  SHA1:
3
- metadata.gz: a2669e69fa48f61aad388fa5fdb1381d3bb1ce02
4
- data.tar.gz: 96d69c067e204aaa554fd7125f2ec3e5c0eb69b4
3
+ metadata.gz: b921c61604c4f0290cf1e6f10b23b0bf2dfe8c98
4
+ data.tar.gz: b44f95ca5fe3914b1e073de52e39aeb79ecb085f
5
5
  SHA512:
6
- metadata.gz: 1c85a02a3183f3ed5e25cd274eb207ba5402d9df11f3eecea790a07213f966c79cbb5838eb4ffcdd32fbb182ee9fb72a85b3c31bf684e0fb7673a16225006fac
7
- data.tar.gz: f70380d502986f74acf2db395db32fe946f3f581a17fe3d0397346ea31eaf28c56e8d5a7e9d8dedf8f60dc6d02fb3af7752290cf2dcd9aeeccc3f6ab2bd51a67
6
+ metadata.gz: 4c5a16630c7fdee791dba7b2f406ace2a126a4a3e4d91b07cc91cd0894e0c874e596ada4acf756411c57b747932293e8b2a06193bd371a27227ada5ea991769d
7
+ data.tar.gz: 797aa29cfafb937b20542d94e10efae50a2f1f33564f4fd9ebc7180e26103bd6ba431d692cb3b6bedf4f14ff884b8c40d8ac57af0f9f58b6b8b969983052d0e8
data/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [6.3.0] 2017-07-13
9
+ ### Added
10
+ - add check-cloudwatch-alarms.rb (@obazoud)
11
+
8
12
  ## [6.2.0] 2017-07-07
9
13
  ### Added
10
14
  - check-ec2-filter.rb: add --min-running-secs flag for specifying
@@ -328,7 +332,8 @@ WARNING: This release contains major breaking changes that will impact all user
328
332
  ### Added
329
333
  - initial release
330
334
 
331
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.2.0...HEAD
335
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.3.0...HEAD
336
+ [6.3.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.2.0...6.3.0
332
337
  [6.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.1.1...6.2.0
333
338
  [6.1.1]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.1.0...6.1.1
334
339
  [6.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/6.0.1...6.1.0
data/README.md CHANGED
@@ -20,10 +20,12 @@
20
20
 
21
21
  **check-cloudwatch-alarm**
22
22
 
23
- **check-cloudwatch-metric**
23
+ **check-cloudwatch-alarms**
24
24
 
25
25
  **check-cloudwatch-composite-metric**
26
26
 
27
+ **check-cloudwatch-metric**
28
+
27
29
  **check-cloudfront-tag**
28
30
 
29
31
  **check-configservice-rules**
@@ -0,0 +1,78 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-cloudwatch-alarms
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin raise a critical if one of cloud watch alarms are in given state.
7
+ #
8
+ # OUTPUT:
9
+ # plain-text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: aws-sdk
16
+ # gem: sensu-plugin
17
+ #
18
+ # USAGE:
19
+ # ./check-cloudwatch-alarms --exclude-alarms "CPUAlarmLow"
20
+ # ./check-cloudwatch-alarms --region eu-west-1 --exclude-alarms "CPUAlarmLow"
21
+ #
22
+ # NOTES:
23
+ #
24
+ # LICENSE:
25
+ # Copyright (c) 2017, Olivier Bazoud, olivier.bazoud@gmail.com
26
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
27
+ # for details.
28
+ #
29
+
30
+ require 'sensu-plugin/check/cli'
31
+ require 'sensu-plugins-aws/common'
32
+ require 'aws-sdk'
33
+
34
+ class CloudWatchCheck < Sensu::Plugin::Check::CLI
35
+ include Common
36
+
37
+ option :aws_region,
38
+ short: '-r AWS_REGION',
39
+ long: '--aws-region REGION',
40
+ description: 'AWS Region (defaults to us-east-1).',
41
+ default: 'us-east-1'
42
+
43
+ option :state,
44
+ description: 'State of the alarm',
45
+ short: '-s STATE',
46
+ long: '--state STATE',
47
+ default: 'ALARM'
48
+
49
+ option :exclude_alarms,
50
+ description: 'Exclude alarms',
51
+ short: '-e EXCLUDE_ALARMS',
52
+ long: '--exclude-alarms',
53
+ proc: proc { |a| a.split(',') },
54
+ default: []
55
+
56
+ def run
57
+ client = Aws::CloudWatch::Client.new
58
+
59
+ options = { state_value: config[:state] }
60
+ alarms = client.describe_alarms(options).metric_alarms
61
+
62
+ if alarms.empty?
63
+ ok "No alarms in '#{config[:state]}' state"
64
+ end
65
+
66
+ config[:exclude_alarms].each do |x|
67
+ alarms.delete_if { |alarm| alarm.alarm_name.match(x) }
68
+ end
69
+
70
+ critical "#{alarms.size} in '#{config[:state]}' state: #{alarms.map(&:alarm_name).join(',')}" unless alarms.empty?
71
+
72
+ ok 'everything looks good'
73
+
74
+ rescue => e
75
+ puts "Error: exception: #{e}"
76
+ critical
77
+ end
78
+ end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 6
4
- MINOR = 2
4
+ MINOR = 3
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: 6.2.0
4
+ version: 6.3.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: 2017-07-07 00:00:00.000000000 Z
11
+ date: 2017-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -264,6 +264,7 @@ executables:
264
264
  - check-certificate-expiry.rb
265
265
  - check-cloudfront-tag.rb
266
266
  - check-cloudwatch-alarm.rb
267
+ - check-cloudwatch-alarms.rb
267
268
  - check-cloudwatch-composite-metric.rb
268
269
  - check-cloudwatch-metric.rb
269
270
  - check-configservice-rules.rb
@@ -344,6 +345,7 @@ files:
344
345
  - bin/check-certificate-expiry.rb
345
346
  - bin/check-cloudfront-tag.rb
346
347
  - bin/check-cloudwatch-alarm.rb
348
+ - bin/check-cloudwatch-alarms.rb
347
349
  - bin/check-cloudwatch-composite-metric.rb
348
350
  - bin/check-cloudwatch-metric.rb
349
351
  - bin/check-configservice-rules.rb