sensu-plugins-consul 1.6.1 → 2.0.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: 921fbb9dc9e457413062488af0f8fd64636f4bedc0deb305d71467603060f600
4
- data.tar.gz: 84c2f9533f10e2c810c6973c21a1f033bdec538a9f4dcd55ca73a8901f0532af
3
+ metadata.gz: 24521ff0a65982295f0e82ae89102583e30f7e5c22590f277918cc6c43724ca9
4
+ data.tar.gz: dfad99c8d6c8f5e8037a9712f576b3d32e83efeeff1de7d5a123a60a70f39a0c
5
5
  SHA512:
6
- metadata.gz: 7f9494f5715ab2ab550956f8b994217286709bb8802d1a2db38335dd70c8ff50e341207878c5e5e5f794a051c8188fdec85cf58dbe72593930603f8104c5654f
7
- data.tar.gz: 37c66408f994098a24dd9b8b13885af0fed8cb8d14199b804359ecba424ed4892484847660222ec6f6ad08740e7da30dddd4790456f6706f32e62226481cdfba
6
+ metadata.gz: 2168a6c0dacbed762a7eaca57f4a8c3374b34aa376888110f7f78548d35a8cfad507e71b06cd23f1cb5e9f4d5d38b3c01aa389cce22f334f5067d62c2d8d5e84
7
+ data.tar.gz: a198f8c0a0913ccad69ef0fd3bb8ef154a3a7a1a86c956c6585ac417c04cc34034a9f55f0966211445fd4828c98237739650db427131897c3bf46553d1fb1c3a
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
+ ## [2.0.0] - 2018-03-07
9
+ ### Security
10
+ - updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)
11
+
12
+ ### Breaking Changes
13
+ - removed ruby `< 2.1` support (@majormoses)
14
+
15
+ ### Changed
16
+ - appeased the cops (@majormoses)
17
+
8
18
  ## [1.6.1] - 2018-03-02
9
19
  ### Fixed
10
20
  - Bug fix for `check-consul-servers` so timeout option works (@joshbenner)
@@ -102,7 +112,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
102
112
  ### Added
103
113
  - initial release
104
114
 
105
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.6.1...HEAD
115
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/2.0.0...HEAD
116
+ [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.6.1...2.0.0
106
117
  [1.6.1]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.6.0...1.6.1
107
118
  [1.6.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.5.0...1.6.0
108
119
  [1.5.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.4.1...1.5.0
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # OUTPUT:
4
6
  # plain text
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-consul-kv-ttl
4
6
  #
@@ -126,8 +128,8 @@ class CheckConsulKvTTL < Sensu::Plugin::Check::CLI
126
128
  kv_status = kv_status.downcase
127
129
 
128
130
  # Flag based off of status
129
- warning 'Warning status detected!' if %w(warning).include? kv_status
130
- critical 'Critical status detected!' if %w(critical unknown).include? kv_status
131
+ warning 'Warning status detected!' if %w[warning].include? kv_status
132
+ critical 'Critical status detected!' if %w[critical unknown].include? kv_status
131
133
  end
132
134
 
133
135
  # Dig to the time
@@ -157,7 +159,7 @@ class CheckConsulKvTTL < Sensu::Plugin::Check::CLI
157
159
  critical "TTL Expired! Elapsed Time: #{elapsed_seconds}" if elapsed_seconds > config[:critical]
158
160
  warning "TTL Expiration Approaching! Elapsed Time: #{elapsed_seconds}" if elapsed_seconds > config[:warning]
159
161
  ok
160
- rescue
162
+ rescue StandardError
161
163
  critical 'Unable to process DateTime objects!'
162
164
  end
163
165
  end
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-consul-leader
4
6
  #
@@ -74,11 +76,11 @@ class ConsulStatus < Sensu::Plugin::Check::CLI
74
76
  def valid_ip(ip)
75
77
  case ip.to_s
76
78
  when Resolv::IPv4::Regex
77
- return true
79
+ true
78
80
  when Resolv::IPv6::Regex
79
- return true
81
+ true
80
82
  else
81
- return false
83
+ false
82
84
  end
83
85
  end
84
86
 
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-consul-maintenance
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-consul-members
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-consul-servers
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-consul-service-health
4
6
  #
@@ -78,20 +80,20 @@ class CheckConsulServiceHealth < Sensu::Plugin::Check::CLI
78
80
  services.push(*s['Checks'])
79
81
  end
80
82
  end
81
- return services
83
+ services
82
84
  elsif config[:nodename]
83
85
  data = []
84
86
  begin
85
87
  services = Diplomat::Node.get(config[:nodename]).Services
86
- rescue
88
+ rescue StandardError
87
89
  services = {}
88
90
  end
89
- services.values.each do |service|
91
+ services.each_value do |service|
90
92
  Diplomat::Health.checks(service['Service']).each do |check|
91
93
  data.push(check) if check.Node == config[:nodename]
92
94
  end
93
95
  end
94
- return data
96
+ data
95
97
  elsif config[:all]
96
98
  Diplomat::Health.state('any')
97
99
  else
@@ -128,8 +130,8 @@ class CheckConsulServiceHealth < Sensu::Plugin::Check::CLI
128
130
  'Status' => checkStatus
129
131
  )
130
132
 
131
- warnings = true if %w(warning).include? checkStatus
132
- criticals = true if %w(critical unknown).include? checkStatus
133
+ warnings = true if %w[warning].include? checkStatus
134
+ criticals = true if %w[critical unknown].include? checkStatus
133
135
  end
134
136
 
135
137
  if config[:fail_if_not_found] && !found
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # check-service-consul
4
6
  #
@@ -99,18 +101,21 @@ class ServiceStatus < Sensu::Plugin::Check::CLI
99
101
  passing = []
100
102
  failing = []
101
103
  data.each do |d|
102
- passing << {
103
- 'node' => d['Node'],
104
- 'service' => d['ServiceName'],
105
- 'service_id' => d['ServiceID'],
106
- 'notes' => d['Notes']
107
- } if d['Status'] == 'passing'
108
- failing << {
109
- 'node' => d['Node'],
110
- 'service' => d['ServiceName'],
111
- 'service_id' => d['ServiceID'],
112
- 'notes' => d['Notes']
113
- } if d['Status'] == 'critical'
104
+ if d['Status'] == 'passing'
105
+ passing << {
106
+ 'node' => d['Node'],
107
+ 'service' => d['ServiceName'],
108
+ 'service_id' => d['ServiceID'],
109
+ 'notes' => d['Notes']
110
+ }
111
+ elsif d['Status'] == 'critical'
112
+ failing << {
113
+ 'node' => d['Node'],
114
+ 'service' => d['ServiceName'],
115
+ 'service_id' => d['ServiceID'],
116
+ 'notes' => d['Notes']
117
+ }
118
+ end
114
119
  end
115
120
 
116
121
  if failing.empty? && passing.empty?
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sensu-plugins-consul/version'
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SensuPluginsConsul
2
4
  module Version
3
- MAJOR = 1
4
- MINOR = 6
5
- PATCH = 1
5
+ MAJOR = 2
6
+ MINOR = 0
7
+ PATCH = 0
6
8
 
7
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 2.0.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-02 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -137,33 +137,33 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '3.2'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rubocop
140
+ name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.40.0
145
+ version: '3.4'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.40.0
152
+ version: '3.4'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rspec
154
+ name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '3.4'
159
+ version: 0.51.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '3.4'
166
+ version: 0.51.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: yard
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -226,7 +226,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - ">="
228
228
  - !ruby/object:Gem::Version
229
- version: 2.0.0
229
+ version: '2.1'
230
230
  required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - ">="