sensu-plugins-elasticsearch 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8670e9f65b20a6f85378ee9032c23b74629e0d6a95a521331cb67bfef2efabec
4
- data.tar.gz: 010d92d8dd23da486812678576f3fe6a875e1e5acd9840eebfcd79144649624d
3
+ metadata.gz: ef07bcbc3469b77850b61ee73377d1a13bee2fa6ea0a7dbfd65115bae0e28fa9
4
+ data.tar.gz: 78d3c54249958733e60a4a36352460e57e2c12889cca77daad277853dcc4a636
5
5
  SHA512:
6
- metadata.gz: 7ee36bc9adefa729af3dd3722c9dae1d155614b573ca3e7e222eef3f60547571305abad3565ba41ba2bbc71175e3cec3695af55748721181cf24046a75662f75
7
- data.tar.gz: 576cf47e7a42ce677da7aaa544de177dfaf7ae7dd5fdce619e92bd1cec07335bc3e7b668a14ec2f4b8a5bc9525febb2fdbc7586ff92f482597122f49c831ede7
6
+ metadata.gz: b6ac31d7db8e34fb4b0fa8d27150e6e6b96eb75c8ed984fc0dac8f3b91bbd9d930f527542a872d95259b65a91dcd524263c6e751cfb4e0bd596ac1a6f3a61581
7
+ data.tar.gz: ad390897ae316fe8a1b015e99539b5ecf13f70c84e0f8fee5ab4cdca6f2bcdda4c19c224a7aa92e2a0016a2ad8ec21ee5f7ec24087ea8d2f6b0622371dc803c1
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.1.0] - 2018-05-23
9
+ ### Added
10
+ - check-es-shard-allocation-status.rb, check-es-file-descriptors.rb, check-es-heap.rb: added `--cert-file` option which allows you to specify a ca-cert to be used to verify TLS (@vin01)
11
+
8
12
  ## [2.0.1] - 2018-03-27
9
13
  ### Security
10
14
  - updated yard dependency to `~> 0.9.11` per: https://nvd.nist.gov/vuln/detail/CVE-2017-17042 (@majormoses)
@@ -251,7 +255,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
251
255
  - initial release
252
256
 
253
257
 
254
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/2.0.1...HEAD
258
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/2.1.0...HEAD
259
+ [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/2.0.1...2.1.0
255
260
  [2.0.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/2.0.0...2.0.1
256
261
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.12.0...2.0.0
257
262
  [1.12.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.11.1...1.12.0
@@ -82,6 +82,10 @@ class ESFileDescriptors < Sensu::Plugin::Check::CLI
82
82
  short: '-e',
83
83
  long: '--https'
84
84
 
85
+ option :cert_file,
86
+ description: 'Cert file to use',
87
+ long: '--cert-file CERT'
88
+
85
89
  def get_es_resource(resource)
86
90
  headers = {}
87
91
  if config[:user] && config[:password]
@@ -95,7 +99,16 @@ class ESFileDescriptors < Sensu::Plugin::Check::CLI
95
99
  'http'
96
100
  end
97
101
 
98
- r = RestClient::Resource.new("#{protocol}://#{config[:host]}:#{config[:port]}#{resource}", timeout: config[:timeout], headers: headers)
102
+ r = if config[:cert_file]
103
+ RestClient::Resource.new("#{protocol}://#{config[:host]}:#{config[:port]}#{resource}",
104
+ ssl_ca_file: config[:cert_file].to_s,
105
+ timeout: config[:timeout],
106
+ headers: headers)
107
+ else
108
+ RestClient::Resource.new("#{protocol}://#{config[:host]}:#{config[:port]}#{resource}",
109
+ timeout: config[:timeout],
110
+ headers: headers)
111
+ end
99
112
  JSON.parse(r.get)
100
113
  rescue Errno::ECONNREFUSED
101
114
  warning 'Connection refused'
@@ -90,6 +90,10 @@ class ESHeap < Sensu::Plugin::Check::CLI
90
90
  short: '-e',
91
91
  long: '--https'
92
92
 
93
+ option :cert_file,
94
+ description: 'Cert file to use',
95
+ long: '--cert-file CERT'
96
+
93
97
  option :all,
94
98
  description: 'Check all nodes in the ES cluster',
95
99
  short: '-a',
@@ -114,7 +118,16 @@ class ESHeap < Sensu::Plugin::Check::CLI
114
118
  'http'
115
119
  end
116
120
 
117
- r = RestClient::Resource.new("#{protocol}://#{config[:host]}:#{config[:port]}#{resource}", timeout: config[:timeout], headers: headers)
121
+ r = if config[:cert_file]
122
+ RestClient::Resource.new("#{protocol}://#{config[:host]}:#{config[:port]}#{resource}",
123
+ ssl_ca_file: config[:cert_file].to_s,
124
+ timeout: config[:timeout],
125
+ headers: headers)
126
+ else
127
+ RestClient::Resource.new("#{protocol}://#{config[:host]}:#{config[:port]}#{resource}",
128
+ timeout: config[:timeout],
129
+ headers: headers)
130
+ end
118
131
  JSON.parse(r.get)
119
132
  rescue Errno::ECONNREFUSED
120
133
  warning 'Connection refused'
@@ -76,6 +76,10 @@ class ESShardAllocationStatus < Sensu::Plugin::Check::CLI
76
76
  short: '-P PASS',
77
77
  long: '--password PASS'
78
78
 
79
+ option :cert_file,
80
+ description: 'Cert file to use',
81
+ long: '--cert-file CERT'
82
+
79
83
  def get_es_resource(resource)
80
84
  headers = {}
81
85
  if config[:user] && config[:password]
@@ -83,7 +87,16 @@ class ESShardAllocationStatus < Sensu::Plugin::Check::CLI
83
87
  headers = { 'Authorization' => auth }
84
88
  end
85
89
 
86
- r = RestClient::Resource.new("#{config[:scheme]}://#{config[:server]}:#{config[:port]}#{resource}", timeout: config[:timeout], headers: headers)
90
+ r = if config[:cert_file]
91
+ RestClient::Resource.new("#{config[:scheme]}://#{config[:server]}:#{config[:port]}#{resource}",
92
+ ssl_ca_file: config[:cert_file].to_s,
93
+ timeout: config[:timeout],
94
+ headers: headers)
95
+ else
96
+ RestClient::Resource.new("#{config[:scheme]}://#{config[:server]}:#{config[:port]}#{resource}",
97
+ timeout: config[:timeout],
98
+ headers: headers)
99
+ end
87
100
  JSON.parse(r.get)
88
101
  rescue Errno::ECONNREFUSED
89
102
  warning 'Connection refused'
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsElasticsearch
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 0
5
- PATCH = 1
4
+ MINOR = 1
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.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: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-es-transport
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
344
  version: '0'
345
345
  requirements: []
346
346
  rubyforge_project:
347
- rubygems_version: 2.7.6
347
+ rubygems_version: 2.7.7
348
348
  signing_key:
349
349
  specification_version: 4
350
350
  summary: Sensu plugins for elasticsearch