sensu-plugins-aws 17.1.0 → 17.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/bin/check-rds-pending.rb +28 -4
- data/lib/sensu-plugins-aws/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b36dab6cf60e69799a81ab1c2230748ef5a37ce59b2a6502d88021f61b08ee5f
|
4
|
+
data.tar.gz: 192ac2ab3a2c8d98a0c54999c3a68907b02435fec764469866f4c06bc0ea7df5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/bin/check-rds-pending.rb
CHANGED
@@ -31,7 +31,7 @@ require 'sensu-plugin/check/cli'
|
|
31
31
|
require 'sensu-plugins-aws'
|
32
32
|
require 'aws-sdk'
|
33
33
|
|
34
|
-
class
|
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
|
-
|
44
|
-
|
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
|