sensu-plugins-etcd 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a20488e15147b25aeabccdfdb4c018fe09a545c
4
- data.tar.gz: b9ba564b84fb59e77f19333d760c92ac5d543455
3
+ metadata.gz: 414ed48ba733f6e53dac7c9ab73757a057af5697
4
+ data.tar.gz: 1e29c7a7c231359a9a41f3e8e899df03f741edff
5
5
  SHA512:
6
- metadata.gz: 17eed10479b3369f9cecf7706835d811acb1f86ef4e037be646e00ae1e81254d558dbddd27ca3094657d9e0659134bc1befab4bb725eaee79e295acade02e7b9
7
- data.tar.gz: 884b7ae0750dfa545cd66803e886ef1ba89d69a4fb36200f5afd874ff6263f308f1ecf628bc3454659a55494b683694948a9229c12def857e6f8a1193cfcd971
6
+ metadata.gz: 8153bbe4f17f9990eec412618cdd5dedfd55af36309901a22320e0a4f44dacfbc80bee51f62a6de632c9c9e1f9279e77110866bdbcdf3f95962cdd8b34dd0ae3
7
+ data.tar.gz: 7879b5f63f05f046cbb0cdf8493f93d5682ee2d677023f15d6643d5ec80364fe82945f7c909dee54c6456bd28a2f8e047b724ed78348175ba1809055017c4325
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -3,7 +3,11 @@ 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.1.0] - 2015-08-27
9
+ ### Added
10
+ - SSL support
7
11
 
8
12
  ## [0.0.3] - 2015-07-14
9
13
  ### Changed
@@ -20,4 +24,4 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
20
24
  - added binstubs
21
25
 
22
26
  ### Changed
23
- - removed cruft from /lib
27
+ - removed cruft from /lib
data/README.md CHANGED
@@ -14,8 +14,18 @@
14
14
 
15
15
  ## Usage
16
16
 
17
+ Usage: check-etcd.rb (options)
18
+ --ca CA SSL CA file
19
+ --cert CERT client SSL cert
20
+ --insecure change SSL verify mode to false
21
+ --key KEY client SSL key
22
+ --passphrase PASSPHRASE passphrase of the SSL key
23
+ -p, --port PORT Etcd port, defaults to 2379
24
+ -h, --host HOST Etcd host, defaults to localhost
25
+ --ssl use HTTPS (default false)
26
+
17
27
  ## Installation
18
28
 
19
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
29
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
20
30
 
21
31
  ## Notes
data/bin/check-etcd.rb CHANGED
@@ -28,6 +28,7 @@
28
28
 
29
29
  require 'sensu-plugin/check/cli'
30
30
  require 'rest-client'
31
+ require 'openssl'
31
32
 
32
33
  #
33
34
  # Etcd Node Status
@@ -45,8 +46,44 @@ class EtcdNodeStatus < Sensu::Plugin::Check::CLI
45
46
  long: '--port PORT',
46
47
  default: '2379'
47
48
 
49
+ option :cert,
50
+ description: 'client SSL cert',
51
+ long: '--cert CERT',
52
+ default: nil
53
+
54
+ option :key,
55
+ description: 'client SSL key',
56
+ long: '--key KEY',
57
+ default: nil
58
+
59
+ option :passphrase,
60
+ description: 'passphrase of the SSL key',
61
+ long: '--passphrase PASSPHRASE',
62
+ default: nil
63
+
64
+ option :ca,
65
+ description: 'SSL CA file',
66
+ long: '--ca CA',
67
+ default: nil
68
+
69
+ option :insecure,
70
+ description: 'change SSL verify mode to false',
71
+ long: '--insecure'
72
+
73
+ option :ssl,
74
+ description: 'use HTTPS (default false)',
75
+ long: '--ssl'
76
+
48
77
  def run
49
- r = RestClient::Resource.new("http://#{config[:server]}:#{config[:port]}/v2/stats/self", timeout: 5).get
78
+ protocol = config[:ssl] ? 'https' : 'http'
79
+
80
+ r = RestClient::Resource.new("#{protocol}://#{config[:server]}:#{config[:port]}/v2/stats/self",
81
+ timeout: 5,
82
+ ssl_client_cert: (OpenSSL::X509::Certificate.new(File.read(config[:cert])) unless config[:cert].nil?),
83
+ ssl_client_key: (OpenSSL::PKey::RSA.new(File.read(config[:key]), config[:passphrase]) unless config[:key].nil?),
84
+ ssl_ca_file: config[:ca],
85
+ verify_ssl: config[:insecure] ? 0 : 1
86
+ ).get
50
87
  if r.code == 200
51
88
  ok 'etcd is up'
52
89
  else
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsEtcd
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 0
5
- PATCH = 3
4
+ MINOR = 1
5
+ PATCH = 0
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-etcd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
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-08-27 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rest-client
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
241
  version: '0'
242
242
  requirements: []
243
243
  rubyforge_project:
244
- rubygems_version: 2.4.6
244
+ rubygems_version: 2.4.8
245
245
  signing_key:
246
246
  specification_version: 4
247
247
  summary: Sensu plugins for etcd
metadata.gz.sig CHANGED
Binary file