sensu-plugins-consul 0.0.4 → 0.0.5

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: 63da30ddced9a6350ce811322511931ff4987bf8
4
- data.tar.gz: d0a48138d067d26511e582d3303129d9ebc051ea
3
+ metadata.gz: 98db577d8684a6cfebd0a2d90f06fc4b9c31d34b
4
+ data.tar.gz: 64f8d3904b1cf24aa8fb47ee3a6376a7f45ac405
5
5
  SHA512:
6
- metadata.gz: 6ac9dfa593b7ef081922cf60c6f98ef481895e14b9a7d9ed81878e8a73cc5746b7ddb138815412ad0a2501a64032cd59bf4933955e6e74773683688931b2a764
7
- data.tar.gz: 823b38000340a111a97defb2dc8f3dbc44c81944a909de886b1ed2f277e75cc071012a611dc46d700a6dc17f10298550119e5ad49cfe1586029890b350db00d5
6
+ metadata.gz: 667d93350669335d570b7b86cf37643e164be4f1c7f8318a74fee710a75df3fc2565867327ce747c82dffba7110f5083e7a03d2e40b3608e1c438ec7b19f9e11
7
+ data.tar.gz: 96b068d475e6d4135d31e266282c7367fb13ab37c38168ea0e7328427e1a5a08316e370f4cb6d94ff7a005e15671c09c22536003207fb2476af004fe1b46d066
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,3 +1,4 @@
1
- ����B@e����Ko�yE:���u���z��-J������Q1]|�ϐ�R�W�
2
- \�$�”�ڵ��ָ������ƃ�[ZT��ʣ :�DT�o���
3
- lP� Hb,�Y��dJ
1
+ ���?��lO�-d-<����r(�z��m:G�Ѝ
2
+ �Ӌ�B0uCRj�ƽ(a�u� ����O^y� Z�Qى���V}ն^)��c~��φҒ?�M��A�v�p�3jŔ�1���6U��22ජ���q��'K����Q?�X
3
+ �Cfr�q�+
4
+ �7+�Zf���,� �,�
data/CHANGELOG.md CHANGED
@@ -3,7 +3,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
- ## Unreleased][unreleased]
6
+ ## Unreleased
7
+
8
+ ## [0.0.5] - 2015-09-28
9
+ ### Added
10
+ - Added check to alert on consul peer servers
11
+
12
+ ## [0.0.4] - 2015-07-14
13
+ ### Added
14
+ - Adding script to remove failed consul nodes prior to 72 hour consul window.
7
15
 
8
16
  ## [0.0.3] - 2015-07-14
9
17
  ### Changed
@@ -23,4 +31,4 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
23
31
  - added binstubs
24
32
 
25
33
  ### Changed
26
- - removed cruft from /lib
34
+ - removed cruft from /lib
data/README.md CHANGED
@@ -5,17 +5,21 @@
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-consul/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-consul)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-consul/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-consul)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-consul.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-consul)
8
- ## Functionality
9
8
  [![Codeship Status for sensu-plugins/sensu-plugins-consul](https://codeship.com/projects/c01130b0-cddd-0132-9d10-36838894891f/status?branch=master)](https://codeship.com/projects/76354)
10
9
 
10
+ ## Functionality
11
+
11
12
  ## Files
12
- * bin/check-consul.rb
13
+ * bin/check-consul-failures.rb
14
+ * bin/check-consul-leader.rb
15
+ * bin/check-consul-servers.rb
13
16
  * bin/check-service-consul.rb
14
17
 
18
+
15
19
  ## Usage
16
20
 
17
21
  ## Installation
18
22
 
19
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
23
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
20
24
 
21
25
  ## Notes
@@ -20,7 +20,6 @@
20
20
  # StatusFailed (4, "failed")
21
21
  #
22
22
 
23
- require 'rubygems' if RUBY_VERSION < '1.9.0'
24
23
  require 'sensu-plugin/check/cli'
25
24
  require 'rest-client'
26
25
  require 'json'
@@ -70,7 +70,7 @@ class ConsulStatus < Sensu::Plugin::Check::CLI
70
70
  end
71
71
  end
72
72
 
73
- def run # rubocop:disable all
73
+ def run
74
74
  r = RestClient::Resource.new("http://#{config[:server]}:#{config[:port]}/v1/status/leader", timeout: 5).get
75
75
  if r.code == 200
76
76
  if valid_ip(strip_ip(r.body))
@@ -0,0 +1,77 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-consul-leader
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin checks if consul is up and reachable. It then checks
7
+ # the status/leader and ensures there is a current leader.
8
+ #
9
+ # OUTPUT:
10
+ # plain text
11
+ #
12
+ # PLATFORMS:
13
+ # Linux
14
+ #
15
+ # DEPENDENCIES:
16
+ # gem: sensu-plugin
17
+ # gem: diplomat
18
+ #
19
+ # USAGE:
20
+ # #YELLOW
21
+ #
22
+ # NOTES:
23
+ #
24
+ # LICENSE:
25
+ # Copyright 2015 Sonian, Inc. and contributors. <support@sensuapp.org>
26
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
27
+ # for details.
28
+ #
29
+
30
+ require 'sensu-plugin/check/cli'
31
+ require 'rest-client'
32
+ require 'json'
33
+
34
+ #
35
+ # Consul Status
36
+ #
37
+ class ConsulStatus < Sensu::Plugin::Check::CLI
38
+ option :server,
39
+ description: 'consul server',
40
+ short: '-s SERVER',
41
+ long: '--server SERVER',
42
+ default: '127.0.0.1'
43
+
44
+ option :port,
45
+ description: 'consul http port',
46
+ short: '-p PORT',
47
+ long: '--port PORT',
48
+ default: '8500'
49
+
50
+ option :min,
51
+ description: 'minimum number of peers',
52
+ short: '-g GREATER THAN',
53
+ long: '--greater GREATER THAN',
54
+ default: 3
55
+
56
+ option :expected,
57
+ description: 'expected number of peers',
58
+ short: '-e EXPECT',
59
+ long: '--expect EXPECT',
60
+ default: 5
61
+
62
+ def run
63
+ json = RestClient::Resource.new("http://#{config[:server]}:#{config[:port]}/v1/status/peers", timeout: 5).get
64
+ peers = JSON.parse(json).length.to_i
65
+ if peers <= config[:min]
66
+ critical "[#{peers}] peers is below critical threshold of [#{config[:min]}]"
67
+ elsif peers != config[:expected]
68
+ warning "[#{peers}] peers is outside of expected count of [#{config[:expected]}]"
69
+ else
70
+ ok 'Peers within threshold'
71
+ end
72
+ rescue Errno::ECONNREFUSED
73
+ critical 'Consul is not responding'
74
+ rescue RestClient::RequestTimeout
75
+ critical 'Consul Connection timed out'
76
+ end
77
+ end
@@ -2,7 +2,7 @@ module SensuPluginsConsul
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
@@ -30,7 +30,7 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
33
+ date: 2015-09-28 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: sensu-plugin
@@ -94,14 +94,14 @@ dependencies:
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: '0.30'
97
+ version: 0.32.1
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: '0.30'
104
+ version: 0.32.1
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rspec
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +204,7 @@ description: Sensu plugins for Consul
204
204
  email: "<sensu-users@googlegroups.com>"
205
205
  executables:
206
206
  - check-service-consul.rb
207
+ - check-consul-servers.rb
207
208
  - check-consul-leader.rb
208
209
  - check-consul-failures.rb
209
210
  extensions: []
@@ -214,6 +215,7 @@ files:
214
215
  - README.md
215
216
  - bin/check-consul-failures.rb
216
217
  - bin/check-consul-leader.rb
218
+ - bin/check-consul-servers.rb
217
219
  - bin/check-service-consul.rb
218
220
  - lib/sensu-plugins-consul.rb
219
221
  - lib/sensu-plugins-consul/version.rb
@@ -243,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
245
  version: '0'
244
246
  requirements: []
245
247
  rubyforge_project:
246
- rubygems_version: 2.4.6
248
+ rubygems_version: 2.4.8
247
249
  signing_key:
248
250
  specification_version: 4
249
251
  summary: Sensu plugins for Consul
metadata.gz.sig CHANGED
Binary file