sensu-plugins-aws 17.1.0 → 17.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
  SHA256:
3
- metadata.gz: 4b3566bdc0ab0237dcd040876fa2b09bdbc7bce7e91da122944e72f30c5b07c8
4
- data.tar.gz: 3e9862e8c961a2f785089eb316b053f45aea4d9f933db02432aaa69eb3f3ca16
3
+ metadata.gz: b36dab6cf60e69799a81ab1c2230748ef5a37ce59b2a6502d88021f61b08ee5f
4
+ data.tar.gz: 192ac2ab3a2c8d98a0c54999c3a68907b02435fec764469866f4c06bc0ea7df5
5
5
  SHA512:
6
- metadata.gz: a912ac844cc7fc1b5a18c4a97a1e641f55222560e8f21575109b95b151bfec06b638ceb1e2051abc1cc1ad7f0accb402266814a2631f603f6bf8b350298d0d20
7
- data.tar.gz: 6ccf79572a2598648d60746e5ce6ea45b43f4cfc055baf2919342c9752ffc8d042d59189a70a6ff380ab1bf515fa41f1a14ba2a44032cbec62b685b903363233
6
+ metadata.gz: 2d9d0d4047cc921381b7852a0863712f180f33ab58ee1ac2a06fc4f35e47312ac19e7a35abc5efe2f56ea70a5538e19901fade16b5bc2cd1c5fa3615170df516
7
+ data.tar.gz: 84b1aa478dda231780147e703339f754f2483343c550966d97bf2d72f0e2f5edd0bd0809ad4a48c3c41d43437a7294d626716376e1c24a8b65f89c3837ca78f5
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
+ ## [17.2.0] - 2019-04-02
9
+ ### Added
10
+ - `check-rds-pending.rb`: adding option `--db-instance-identifier` to support checking only a single db instance for pending maintenance events, instead of all instances in a region. (@mattdoller)
11
+
8
12
  ## [17.1.0] - 2019-04-02
9
13
  ### Changed
10
14
  - `metrics-cloudfront.rb` now accepts multiple metrics. (@boutetnico)
@@ -561,6 +565,7 @@ WARNING: This release contains major breaking changes that will impact all user
561
565
  - initial release
562
566
 
563
567
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.1.0...HEAD
568
+ [17.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.1.0...17.2.0
564
569
  [17.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.0.0...17.1.0
565
570
  [17.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/16.2.0...17.0.0
566
571
  [16.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/16.1.0...16.2.0
@@ -31,7 +31,7 @@ require 'sensu-plugin/check/cli'
31
31
  require 'sensu-plugins-aws'
32
32
  require 'aws-sdk'
33
33
 
34
- class CheckRDSEvents < Sensu::Plugin::Check::CLI
34
+ class CheckRDSPending < Sensu::Plugin::Check::CLI
35
35
  include Common
36
36
 
37
37
  option :aws_region,
@@ -40,13 +40,17 @@ class CheckRDSEvents < Sensu::Plugin::Check::CLI
40
40
  description: 'AWS Region (such as eu-west-1).',
41
41
  default: 'us-east-1'
42
42
 
43
- def run
44
- rds = Aws::RDS::Client.new
43
+ option :db_instance_identifier,
44
+ short: '-d DB_INSTANCE_IDENTIFIER',
45
+ long: '--db-instance-identifier DB_INSTANCE_IDENTIFIER',
46
+ description: 'The DB Identifier of the instance to check',
47
+ default: nil
45
48
 
49
+ def run
46
50
  begin
47
51
  # fetch all clusters identifiers
48
- clusters = rds.describe_db_instances[:db_instances].map { |db| db[:db_instance_identifier] }
49
52
  maint_clusters = []
53
+
50
54
  if clusters.any?
51
55
  # Check if there is any pending maintenance required
52
56
  pending_record = rds.describe_pending_maintenance_actions(filters: [{ name: 'db-instance-id', values: clusters }])
@@ -64,4 +68,24 @@ class CheckRDSEvents < Sensu::Plugin::Check::CLI
64
68
  critical("Clusters w/ pending maintenance required: #{maint_clusters.join(',')}")
65
69
  end
66
70
  end
71
+
72
+ private
73
+
74
+ def rds
75
+ @rds ||= Aws::RDS::Client.new
76
+ end
77
+
78
+ def clusters
79
+ @clusters ||= begin
80
+ params = if config[:db_instance_identifier]
81
+ { db_instance_identifier: config[:db_instance_identifier] }
82
+ else
83
+ {}
84
+ end
85
+
86
+ rds.describe_db_instances(params)[:db_instances].map do |db|
87
+ db[:db_instance_identifier]
88
+ end
89
+ end
90
+ end
67
91
  end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 17
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  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: 17.1.0
4
+ version: 17.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors