sensu-plugins-aws 17.2.0 → 18.1.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 +4 -4
- data/CHANGELOG.md +13 -1
- data/bin/check-alb-target-group-health.rb +5 -1
- data/bin/check-ec2-cpu_balance.rb +15 -6
- data/lib/sensu-plugins-aws/version.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54838ff66b0e5849220a8b08d1b76ec644b68407eca3d01b6bff2831023ccd7f
|
4
|
+
data.tar.gz: f11e57b9e4a804fba44694711fc0985f18b00ba10e4350ed576b53490787f304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 353c9b344ed3940c55144ab907b987fc7c446810199a0ec9656f557d44d2a362c706d60112822afdcea5b3459d0fc839155f021d7244169b83845f0c5df8f967
|
7
|
+
data.tar.gz: 1d4ca6e7c132ae96d80935babfb02e9f4016586d01359ebf8ee550c2fcd5eabd44fa43561aa2a4a6a134f2d317acc5585fc9ffd47d72b19a8c5646ea91905256
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,16 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [18.1.0] - 2019-05-06
|
9
|
+
### Added
|
10
|
+
- `check-ec2-cpu_balance.rb`: `--filter` option added to filter which instance to check. (@boutetnico)
|
11
|
+
|
12
|
+
## [18.0.0] - 2019-04-2
|
13
|
+
### Breaking Changes
|
14
|
+
- `check-alb-target-group-health.rb` will now alert if a n ALB has no health targets (@kunal-plivo)
|
15
|
+
- removed ruby `< 2.3` support (@majormoses)
|
16
|
+
- bump `sensu-plugin` dependency from `~> 2.0` to `~> 4.0` you can read the changelog entries for [4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#400---2018-02-17) and [3.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#300---2018-12-04) (@majormoses)
|
17
|
+
|
8
18
|
## [17.2.0] - 2019-04-02
|
9
19
|
### Added
|
10
20
|
- `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)
|
@@ -564,7 +574,9 @@ WARNING: This release contains major breaking changes that will impact all user
|
|
564
574
|
### Added
|
565
575
|
- initial release
|
566
576
|
|
567
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/
|
577
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.1.0...HEAD
|
578
|
+
[18.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.0.0...18.1.0
|
579
|
+
[18.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.2.0...18.0.0
|
568
580
|
[17.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.1.0...17.2.0
|
569
581
|
[17.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.0.0...17.1.0
|
570
582
|
[17.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/16.2.0...17.0.0
|
@@ -68,9 +68,11 @@ class CheckALBTargetGroupHealth < Sensu::Plugin::Check::CLI
|
|
68
68
|
target_groups.each do |target_group|
|
69
69
|
health = alb.describe_target_health(target_group_arn: target_group.target_group_arn)
|
70
70
|
unhealthy_targets = health.target_health_descriptions.select { |t| t.target_health.state == 'unhealthy' }.map { |t| t.target.id }
|
71
|
-
|
71
|
+
healthy_targets = health.target_health_descriptions.select { |t| t.target_health.state == 'healthy' }.map { |t| t.target.id }
|
72
|
+
if !unhealthy_targets.empty? || healthy_targets.empty?
|
72
73
|
unhealthy_groups[target_group.target_group_name] = {
|
73
74
|
unhealthy_targets: unhealthy_targets,
|
75
|
+
healthy_targets: healthy_targets,
|
74
76
|
total_targets: health.target_health_descriptions.size
|
75
77
|
}
|
76
78
|
end
|
@@ -84,6 +86,8 @@ class CheckALBTargetGroupHealth < Sensu::Plugin::Check::CLI
|
|
84
86
|
if !unhealthy_groups.empty?
|
85
87
|
message = 'Unhealthy ALB target groups: '
|
86
88
|
message += unhealthy_groups.map { |target_group, value| "#{target_group} - #{value[:unhealthy_targets].size}/#{value[:total_targets]} unhealthy targets: {#{value[:unhealthy_targets].join(', ')}}" }.join(', ')
|
89
|
+
message += ' : Healthy ALB target groups: '
|
90
|
+
message += unhealthy_groups.map { |target_group, value| "#{target_group} - #{value[:healthy_targets].size}/#{value[:total_targets]} healthy targets: {#{value[:healthy_targets].join(', ')}}" }.join(', ')
|
87
91
|
if config[:crit]
|
88
92
|
critical message
|
89
93
|
else
|
@@ -19,6 +19,7 @@
|
|
19
19
|
# ./check-ec2-cpu_balance -c 20
|
20
20
|
# ./check-ec2-cpu_balance -w 25 -c 20
|
21
21
|
# ./check-ec2-cpu_balance -c 20 -t 'Name'
|
22
|
+
# ./check-ec2-cpu_balance -c 20 -t 'Name' -F "{name:tag-value,values:[infrastructure]}"
|
22
23
|
#
|
23
24
|
# NOTES:
|
24
25
|
#
|
@@ -31,9 +32,11 @@
|
|
31
32
|
require 'sensu-plugins-aws'
|
32
33
|
require 'sensu-plugin/check/cli'
|
33
34
|
require 'aws-sdk'
|
35
|
+
require 'sensu-plugins-aws/filter'
|
34
36
|
|
35
37
|
class EC2CpuBalance < Sensu::Plugin::Check::CLI
|
36
38
|
include Common
|
39
|
+
include Filter
|
37
40
|
|
38
41
|
option :critical,
|
39
42
|
description: 'Trigger a critical when value is below VALUE',
|
@@ -66,6 +69,12 @@ class EC2CpuBalance < Sensu::Plugin::Check::CLI
|
|
66
69
|
proc: proc { |x| x.split(',') },
|
67
70
|
default: %w[t2 t3]
|
68
71
|
|
72
|
+
option :filter,
|
73
|
+
short: '-F FILTER',
|
74
|
+
long: '--filter FILTER',
|
75
|
+
description: 'String representation of the filter to apply',
|
76
|
+
default: '{}'
|
77
|
+
|
69
78
|
def data(instance)
|
70
79
|
client = Aws::CloudWatch::Client.new
|
71
80
|
stats = 'Average'
|
@@ -94,14 +103,14 @@ class EC2CpuBalance < Sensu::Plugin::Check::CLI
|
|
94
103
|
end
|
95
104
|
|
96
105
|
def run
|
106
|
+
filters = Filter.parse(config[:filter])
|
107
|
+
filters.push(
|
108
|
+
name: 'instance-state-name',
|
109
|
+
values: ['running']
|
110
|
+
)
|
97
111
|
ec2 = Aws::EC2::Client.new
|
98
112
|
instances = ec2.describe_instances(
|
99
|
-
filters:
|
100
|
-
{
|
101
|
-
name: 'instance-state-name',
|
102
|
-
values: ['running']
|
103
|
-
}
|
104
|
-
]
|
113
|
+
filters: filters
|
105
114
|
)
|
106
115
|
|
107
116
|
messages = "\n"
|
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:
|
4
|
+
version: 18.1.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: 2019-
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -417,7 +417,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
417
417
|
requirements:
|
418
418
|
- - ">="
|
419
419
|
- !ruby/object:Gem::Version
|
420
|
-
version: 2.
|
420
|
+
version: 2.3.0
|
421
421
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
422
422
|
requirements:
|
423
423
|
- - ">="
|