sensu-plugins-aws 12.1.0 → 12.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: dc08d77c4f4e2d59086492322c080d5796b3ecafcd26965763f441de8b191300
4
- data.tar.gz: 3c6d7077935ea918ca4db9bc9844e4ea42e2e62ecf1580e048c5497cc6b51e94
3
+ metadata.gz: ce55a0c21af3905f22f4c36f0c47886c571e4f03c75cded90e38337c281f1a57
4
+ data.tar.gz: 4d3a0a6038e3437ae00730141aac0960f8d2771ea1ff387844f1db3224c1a536
5
5
  SHA512:
6
- metadata.gz: 963970d678c9ee70c61184041388f0ccf7ed143c5d67dff4a90dfb71869cd248f248d1057da7119f267bcac6cefd365393bba200f380097c1275e0a23269b88d
7
- data.tar.gz: 2053a94ae790488fb04067ec9a59d4b99a1f14e626bd316c00964469cfb38ba30a8be97ea2125e94f212d110c07dcdf3a0f66da88acab7335fc25ac73a4da243
6
+ metadata.gz: 7f74d5fc377602de4098a55fb91215e41aa0729c95499d70a19154c00c8c313bdc467a9f5435b42092114745f132bb081e04c9e2a7abfe8794d92e0bdc5847f7
7
+ data.tar.gz: 8e0216498809a7b8b3fb9ea55ddeaa356a9c964253700c0dc223994053c26d877cc8e5bb5d12ea97e20b522aa6755d8e18790702caf830633df7ab50a7ee4f64
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
+ ## [12.2.0] - 2018-09-14
9
+ ### Added
10
+ - Add `check-direct-connect-virtual-interfaces.rb` to check the status of Direct Connect virtual interfaces
11
+
8
12
  ## [12.1.0] - 2018-08-28
9
13
  ### Added
10
14
  - new `check-efs.rb: checks cloudwatch metrics with the efs namespace for an arbitrary metric (@ivanfetch)
@@ -494,7 +498,8 @@ WARNING: This release contains major breaking changes that will impact all user
494
498
  ### Added
495
499
  - initial release
496
500
 
497
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/12.1.0...HEAD
501
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/12.2.0...HEAD
502
+ [12.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/12.1.0...12.2.0
498
503
  [12.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/12.0.0...12.1.0
499
504
  [12.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.6.0...12.0.0
500
505
  [11.6.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/11.5.1...11.6.0
data/README.md CHANGED
@@ -36,6 +36,8 @@
36
36
 
37
37
  **check-dynamodb-throttle.rb**
38
38
 
39
+ **check-direct-connect-virtual-interfaces.rb**
40
+
39
41
  **check-ebs-snapshots.rb**
40
42
 
41
43
  **check-ebs-burst-limit.rb**
@@ -170,6 +172,7 @@
170
172
  * /bin/check-cloudwatch-composite-metric.rb
171
173
  * /bin/check-dynamodb-capacity.rb
172
174
  * /bin/check-dynamodb-throttle.rb
175
+ * /bin/check-direct-connect-virtual-interfaces.rb
173
176
  * /bin/check-ebs-burst-limit.rb
174
177
  * /bin/check-ebs-snapshots.rb
175
178
  * /bin/check-ec2-filter.rb
@@ -0,0 +1,84 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-direct-connect-virtual-interfaces
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin uses the AWS Direct Connect API to check the status
7
+ # of virtual interfaces
8
+ #
9
+ # CRIT: one or more interfaces status not 'available' (down)
10
+ # WARN: no virtual interfaces detected
11
+ # OK: all interfaces checked available
12
+ #
13
+ # OUTPUT:
14
+ # plain-text
15
+ #
16
+ # PLATFORMS:
17
+ # Linux, Windows, Mac
18
+ #
19
+ # DEPENDENCIES:
20
+ # gem: aws-sdk
21
+ # gem: sensu-plugin
22
+ #
23
+ # USAGE:
24
+ # ./check-direct-connect.rb -r {us-east-1|eu-west-1} [-c all]
25
+ #
26
+ # NOTES:
27
+ #
28
+ # LICENSE:
29
+ # Guillaume Delacour <guillaume.delacour@fr.clara.net>
30
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
31
+ # for details.
32
+
33
+ require 'sensu-plugin/check/cli'
34
+ require 'sensu-plugins-aws'
35
+ require 'aws-sdk'
36
+
37
+ class CheckDcVirtualInterfacesHealth < Sensu::Plugin::Check::CLI
38
+ include Common
39
+
40
+ option :aws_region,
41
+ short: '-r AWS_REGION',
42
+ long: '--aws-region AWS_REGION',
43
+ description: 'The AWS region in which to check rules. Currently only available in us-east-1.',
44
+ default: 'us-east-1'
45
+
46
+ option :connection_id,
47
+ short: '-c CONNECTION_ID',
48
+ long: '--connection-id CONNECTION_ID',
49
+ description: 'The connection id to check. Default is to check all connection ids',
50
+ default: 'all'
51
+
52
+ def dc_client
53
+ @dc_client ||= Aws::DirectConnect::Client.new
54
+ end
55
+
56
+ def virtual_interfaces_details(connection_id = 'all')
57
+ if connection_id == 'all'
58
+ dc_client.describe_virtual_interfaces
59
+ else
60
+ dc_client.describe_virtual_interfaces(connection_id: connection_id)
61
+ end
62
+ end
63
+
64
+ def run
65
+ virtual_interfaces_healths = virtual_interfaces_details(config[:connection_id])
66
+ if virtual_interfaces_healths[0].length.zero?
67
+ warning('No virtual interfaces to check')
68
+ end
69
+
70
+ unhealthy = []
71
+
72
+ virtual_interfaces_healths[0].each do |virtual_interface|
73
+ unhealthy.push(virtual_interface.virtual_interface_name) if virtual_interface.virtual_interface_state != 'available'
74
+ end
75
+
76
+ if !unhealthy.length.zero?
77
+ critical("Not 'available' virtual interfaces: #{unhealthy.join ', '}")
78
+ else
79
+ ok(config[:connection_id].to_s)
80
+ end
81
+ rescue StandardError => e
82
+ unknown "An error occurred processing AWS DirectConnect API: #{e.message}"
83
+ end
84
+ end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsAWS
2
2
  module Version
3
3
  MAJOR = 12
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 12.2.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: 2018-08-28 00:00:00.000000000 Z
11
+ date: 2018-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -269,6 +269,7 @@ executables:
269
269
  - check-cloudwatch-composite-metric.rb
270
270
  - check-cloudwatch-metric.rb
271
271
  - check-configservice-rules.rb
272
+ - check-direct-connect-virtual-interfaces.rb
272
273
  - check-dynamodb-capacity.rb
273
274
  - check-dynamodb-throttle.rb
274
275
  - check-ebs-burst-limit.rb
@@ -354,6 +355,7 @@ files:
354
355
  - bin/check-cloudwatch-composite-metric.rb
355
356
  - bin/check-cloudwatch-metric.rb
356
357
  - bin/check-configservice-rules.rb
358
+ - bin/check-direct-connect-virtual-interfaces.rb
357
359
  - bin/check-dynamodb-capacity.rb
358
360
  - bin/check-dynamodb-throttle.rb
359
361
  - bin/check-ebs-burst-limit.rb