sensu-plugins-elasticsearch 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: 3f7600762037d73659509576437eef0a316a9d5a
4
- data.tar.gz: e0cc27195701ab4049c8f6ea15bcb968c390ad92
3
+ metadata.gz: 90fbda760f74eae51619a41d8da2201f3f62caa9
4
+ data.tar.gz: 647f75c70da606f865758926e1f25b2572b06f61
5
5
  SHA512:
6
- metadata.gz: d2801947e4560f554fbddb7bbe44e1bcd9a3c20b83648e10311be52fc7f27eefe3ab54118a5c90fb822e39486c381b3c32f3840f52f603491700597dcbe16830
7
- data.tar.gz: d81addcbe586df2a477c0096121da1fb5596261b622ab1078877dc4635fe05b7027b3cd896ec6922a792b12bd7a85d5324c72719fe2c302c15ae313562404725
6
+ metadata.gz: d7629bfa0302befb14df1c43c363f01f41be65c4981168c01e978754b173f5038ae5457b84768ce76fac9ab7ce0b128634ef94e5f1a433811e859d2bde456d67
7
+ data.tar.gz: db8e5a2d01275a48dbb84d6bd6cd592a7a5ffc6d7cf8ef202fb01fadb6286e2de99cdfdedf985e9f6eebc307b081f9e8a516b891b51f45d1834752fa55fc7d8b
@@ -5,6 +5,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.1.2] - 2016-12-29
9
+ ### Fixed
10
+ - Fixed metrics-es-node-graphite.rb was not compatible with Elasticsearch 5.0 (@woqer)
11
+ - Make query lib compatible with ES 5+ (@jackfengji)
12
+
8
13
  ## [1.1.1] - 2016-11-26
9
14
  ### Fixed
10
15
  - Fixed check-es-file-descriptors.rb was not compatible with Elasticsearch 5.0 (@woqer)
@@ -126,7 +131,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
126
131
  ### Added
127
132
  - initial release
128
133
 
129
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.1.1...HEAD
134
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.1.2...HEAD
135
+ [1.1.2]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.1.1...1.1.2
130
136
  [1.1.1]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.1.0...1.1.1
131
137
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/1.0.0...1.1.0
132
138
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-elasticsearch/compare/0.5.3...1.0.0
@@ -151,7 +151,15 @@ class ESNodeGraphiteMetrics < Sensu::Plugin::Metric::CLI::Graphite
151
151
 
152
152
  es_version = Gem::Version.new(acquire_es_version)
153
153
 
154
- if es_version >= Gem::Version.new('1.0.0')
154
+ if es_version >= Gem::Version.new('3.0.0')
155
+ stats_query_array = %w(indices http network transport thread_pool)
156
+ stats_query_array.push('jvm') if jvm_stats == true
157
+ stats_query_array.push('os') if os_stat == true
158
+ stats_query_array.push('process') if process_stats == true
159
+ stats_query_array.push('tp_stats') if tp_stats == true
160
+ stats_query_array.push('fs') if fs_stats == true
161
+ stats_query_string = stats_query_array.join(',')
162
+ elsif es_version >= Gem::Version.new('1.0.0')
155
163
  stats_query_array = %w(indices http network transport thread_pool)
156
164
  stats_query_array.push('jvm') if jvm_stats == true
157
165
  stats_query_array.push('os') if os_stat == true
@@ -175,7 +183,9 @@ class ESNodeGraphiteMetrics < Sensu::Plugin::Metric::CLI::Graphite
175
183
  ].join('&')
176
184
  end
177
185
 
178
- stats = if es_version >= Gem::Version.new('1.0.0')
186
+ stats = if es_version >= Gem::Version.new('3.0.0')
187
+ get_es_resource("/_nodes/_local/stats/#{stats_query_string}")
188
+ elsif es_version >= Gem::Version.new('1.0.0')
179
189
  get_es_resource("/_nodes/_local/stats?#{stats_query_string}")
180
190
  else
181
191
  get_es_resource("/_cluster/nodes/_local/stats?#{stats_query_string}")
@@ -83,21 +83,20 @@ module ElasticsearchQuery
83
83
  unless es_date_start.nil?
84
84
  options[:body] = {
85
85
  'query' => {
86
- 'filtered' => {
87
- 'query' => {
86
+ 'bool' => {
87
+ 'must' => [{
88
88
  'query_string' => {
89
89
  'default_field' => config[:search_field],
90
90
  'query' => config[:query]
91
91
  }
92
- },
93
- 'filter' => {
92
+ }, {
94
93
  'range' => {
95
94
  config[:timestamp_field] => {
96
95
  'gt' => es_date_start,
97
96
  'lt' => end_time.strftime('%Y-%m-%dT%H:%M:%S')
98
97
  }
99
98
  }
100
- }
99
+ }]
101
100
  }
102
101
  }
103
102
  }
@@ -2,7 +2,7 @@ module SensuPluginsElasticsearch
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- PATCH = 1
5
+ PATCH = 2
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: 1.1.1
4
+ version: 1.1.2
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: 2016-11-26 00:00:00.000000000 Z
11
+ date: 2016-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client