sensu-plugins-aws 18.0.0 → 18.1.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 +6 -1
- data/bin/check-ec2-cpu_balance.rb +15 -6
- data/lib/sensu-plugins-aws/version.rb +1 -1
- metadata +2 -2
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,10 @@ 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
|
+
|
8
12
|
## [18.0.0] - 2019-04-2
|
9
13
|
### Breaking Changes
|
10
14
|
- `check-alb-target-group-health.rb` will now alert if a n ALB has no health targets (@kunal-plivo)
|
@@ -570,7 +574,8 @@ WARNING: This release contains major breaking changes that will impact all user
|
|
570
574
|
### Added
|
571
575
|
- initial release
|
572
576
|
|
573
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/18.
|
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
|
574
579
|
[18.0.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.2.0...18.0.0
|
575
580
|
[17.2.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.1.0...17.2.0
|
576
581
|
[17.1.0]: https://github.com/sensu-plugins/sensu-plugins-aws/compare/17.0.0...17.1.0
|
@@ -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: 18.
|
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
|