sensu-plugins-consul 0.0.6 → 0.0.7

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: 34c62d8ff6b839434406908838a9069edf8f339c
4
- data.tar.gz: 5c9deb2475037e36c4cacf0b212eb11624a25449
3
+ metadata.gz: 862a9ac244272cb6c2291e84adacf7d73363592f
4
+ data.tar.gz: 57ff050c889a7b61fdd7e4a744b1745a48bbf834
5
5
  SHA512:
6
- metadata.gz: 47a031c67fec164893b99a67fafef0b3353cad25bc47d6146c034e21bf96cb8e74614cad808b43f33f2c4ab0062b79cb0f58a4ef3e18fc304e8dfa55de0f383b
7
- data.tar.gz: 82fb703b3e9e9ff3b974f384063a781e92df0947267821b5f0d52a82c2882cbd16b3bcc766588022ffc8837ca4c8870fcf461eb1f9a771bad9c67a619bc4b2a0
6
+ metadata.gz: 0170d2e57c44da74fbb0dc1b69f12863286e3cbb77fcd2dd2baaa837e002dde081be5489f81106efd061584a2eebb02aa56400275be6458637bcb9aeda0a5393
7
+ data.tar.gz: cc837bbc49ea6bf2bc2759712453c87a0dc546c0c46692c07859b7a8f891ca6f644f828fde53f744132e7c258b63eddea65260c5190f24d20965cf4067bbc5fb
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- { �����;LI*�G Z��P<�P,R�:�����+%�q��r0fPg08�2�!m?�� ط�~ig���hͿŻ�4�`z8�"�)�.���C��vHn���}�Fߚ���G�i�䚫���b��Y����Z�m�,��1fA.W�L֩H��ѝY��V�Ծ �$�i�����.���3T���ْ��=GpIL�R�7�������K�p��E*��g:�i1J��j����l��L ) `��"���Y��
1
+ .H1���bC�^ImZ{k�j�
2
+ v�:���%��{$ad�|v�E��⃌�Ԁ&��]y�"!>�^�]�sS����p�n��YEW���;|�/��-���ׯ�B�Y������B�;�&�k'�J�*�)"���!�9�c<��f#�����I>�T�����RWR���G���q@��*�ŋ�j��D2��WՃ!��^A�/���3�/�Y&b$���Ѯs��N�̱�e8T�㫩��:~TK�0�j�b��Z�m�1�
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
6
6
  ## [Unreleased]
7
7
  - Nothing
8
8
 
9
+ ## [0.0.7] - 2015-11-12
10
+ ### Changed
11
+ - Consul checks with UNKNOWN status should fail gracefully
12
+
13
+ ### Fixed
14
+ - Consul service check fixes
15
+
9
16
  ## [0.0.6] - 2015-09-29
10
17
  ### Changed
11
18
  - Bug fixes for check-consul-servers.rb
data/README.md CHANGED
@@ -15,7 +15,6 @@
15
15
  * bin/check-consul-servers.rb
16
16
  * bin/check-service-consul.rb
17
17
 
18
-
19
18
  ## Usage
20
19
 
21
20
  ## Installation
@@ -53,9 +53,11 @@ class ConsulStatus < Sensu::Plugin::Check::CLI
53
53
  else
54
54
  critical 'Consul is not responding'
55
55
  end
56
- rescue Errno::ECONNREFUSED
57
- critical 'Consul is not responding'
58
- rescue RestClient::RequestTimeout
59
- critical 'Consul Connection timed out'
56
+ rescue Errno::ECONNREFUSED
57
+ critical 'Consul is not responding'
58
+ rescue RestClient::RequestTimeout
59
+ critical 'Consul Connection timed out'
60
+ rescue RestClient::Exception => e
61
+ unknown "Consul returned: #{e}"
60
62
  end
61
63
  end
@@ -85,5 +85,7 @@ class ConsulStatus < Sensu::Plugin::Check::CLI
85
85
  critical 'Consul is not responding'
86
86
  rescue RestClient::RequestTimeout
87
87
  critical 'Consul Connection timed out'
88
+ rescue RestClient::Exception => e
89
+ unknown "Consul returned: #{e}"
88
90
  end
89
91
  end
@@ -73,5 +73,7 @@ class ConsulStatus < Sensu::Plugin::Check::CLI
73
73
  critical 'Consul is not responding'
74
74
  rescue RestClient::RequestTimeout
75
75
  critical 'Consul Connection timed out'
76
+ rescue RestClient::Exception => e
77
+ unknown "Consul returned: #{e}"
76
78
  end
77
79
  end
@@ -54,22 +54,34 @@ class ServiceStatus < Sensu::Plugin::Check::CLI
54
54
  else
55
55
  Diplomat::Health.checks(config[:service])
56
56
  end
57
+ rescue Faraday::ConnectionFailed => e
58
+ warning "Connection error occurred: #{e}"
59
+ rescue StandardError => e
60
+ unknown "Exception occurred when checking consul service: #{e}"
57
61
  end
58
62
 
59
63
  # Main function
60
64
  #
61
65
  def run
62
66
  data = acquire_service_data
63
- message = []
67
+ passing = []
68
+ failing = []
64
69
  data.each do |d|
65
- message << {
70
+ passing << {
66
71
  'node' => d['Node'],
67
72
  'service' => d['ServiceName'],
68
73
  'service_id' => d['ServiceID'],
69
74
  'notes' => d['Notes']
70
- } unless d['Status'] == 'passing'
75
+ } if d['Status'] == 'passing'
76
+ failing << {
77
+ 'node' => d['Node'],
78
+ 'service' => d['ServiceName'],
79
+ 'service_id' => d['ServiceID'],
80
+ 'notes' => d['Notes']
81
+ } if d['Status'] == 'failing'
71
82
  end
72
- critical message unless message == '[]'
73
- ok
83
+ unknown 'Could not find service - are there checks defined?' if failing.empty? && passing.empty?
84
+ critical failing unless failing.empty?
85
+ ok passing unless passing.empty?
74
86
  end
75
87
  end
@@ -2,7 +2,7 @@ module SensuPluginsConsul
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 6
5
+ PATCH = 7
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.6
4
+ version: 0.0.7
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-09-29 00:00:00.000000000 Z
33
+ date: 2015-11-12 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: sensu-plugin
@@ -66,14 +66,14 @@ dependencies:
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 0.11.0
69
+ version: 0.14.0
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.11.0
76
+ version: 0.14.0
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: codeclimate-test-reporter
79
79
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- L?(f��/O��,�4W��_�������L���92<� �;���x���"�F�����Ĭ��W���\Q�+��A_v��r���Ww�4��'�<��uM<��Ab8��p^өJ.f��������/nn�ߡ���3�DAR�+4���<�ͤ%c��B/:*�[˜d��R[��m��Btcu�)���B
1
+ #~N��P��Қ�m[[5��L��1CZ�[9iRZ����=)e4�Sd^���Ω���t���N��vdVo����GN���MuژK��oV�%Q^��\��Q�����q3��l< ,��3GM��z|�F�֮@�P��,�zE0
2
+ ��r3��g�tSKE�+�.�T��3p���J�)�[�\J�V������fr2}�=BP���/r��џ��t�Z=�i��%۝���+9b[_������K����U?E�|H