sensu-plugins-openldap 0.0.3 → 1.0.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: be0d4e9fac7ade558f069d99c7e43e60d4e3ca26
4
- data.tar.gz: 0db64eb580d7f9729e55e848405030b2bd4c61df
3
+ metadata.gz: 2824d3133377be5e002896c57aa529d737b1bc4c
4
+ data.tar.gz: 2ca395f99861144f655751b87cdc6d73f0eda2a9
5
5
  SHA512:
6
- metadata.gz: c115bf8886cffaaf560214f7673e1794c7e9efabc394eedabe9742b31a1adf05ffa9ac04f2cdc85d7922b54a838c3422c302deeecaa0cef87ed5d10251fbbc57
7
- data.tar.gz: 2e10dbf829a55b90b8341a9fcb095a356647b1bbf4acc49edbfb562e58ad7daa28a513022bec5f0ea7eef7ba345f323000259956ca9f59bda222f15b93f14847
6
+ metadata.gz: 359c5718912d0eb01ef744fe285931ea674d82830cf8b434629e09101687b403deae7620917db7f9aee527a5c630409f4349edc1fe83c00b5911ebab720e8c7d
7
+ data.tar.gz: af5f26d0f57c10dd57acdf79cf174cffc4fbebda06927162d018b2018e9569e66e6da1479a8cbc6caaba13c4ec77f6eaed358f9d311876ffb61e8cde02a8797a
data/CHANGELOG.md CHANGED
@@ -3,14 +3,21 @@ 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
+ ## [1.0.0] - 2017-01-17
9
+ ### Added
10
+ - check-syncrepl.rb: Add `--ca-certificate`, `--certificate` and `--encryption` options (@moriyoshi)
11
+ - Ruby 2.3.0 support (@eheydrick)
12
+
13
+ ### Removed
14
+ - Ruby < 2.1 support (@eheydrick)
7
15
 
8
16
  ## [0.0.3] - 2015-07-14
9
17
  ### Changed
10
18
  - updated sensu-plugin gem to 1.2.0
11
19
 
12
20
  ## [0.0.2] - 2015-06-03
13
-
14
21
  ### Fixed
15
22
  - added binstubs
16
23
 
@@ -18,7 +25,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
18
25
  - removed cruft from /lib
19
26
 
20
27
  ## 0.0.1 - 2015-05-21
21
-
22
28
  ### Added
23
29
  - initial release
24
30
 
31
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-openldap/compare/1.0.0...HEAD
32
+ [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-openldap/compare/0.0.3...1.0.0
33
+ [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-openldap/compare/0.0.2...0.0.3
34
+ [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-openldap/compare/0.0.1...0.0.2
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-openldap/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-openldap)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-openldap/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-openldap)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-openldap.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-openldap)
8
- [ ![Codeship Status for sensu-plugins/sensu-plugins-openldap](https://codeship.com/projects/7cc16ea0-db3b-0132-9eb0-0eed4ec53b27/status?branch=master)](https://codeship.com/projects/79575)
9
8
 
10
9
  ## Functionality
11
10
 
@@ -17,6 +16,6 @@
17
16
 
18
17
  ## Installation
19
18
 
20
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
19
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
21
20
 
22
21
  ## Notes
@@ -3,7 +3,9 @@
3
3
  # check-syncrepl
4
4
  #
5
5
  # DESCRIPTION:
6
- # This plugin checks OpenLDAP nodes to veryfiy syncrepl is working.
6
+ # This plugin checks that OpenLDAP Sync replication is working by
7
+ # comparing the context change sequence number (contextCSN) of
8
+ # a list of servers.
7
9
  # The plugin will attempt to use an unauthenticated connection if no
8
10
  # user name (with the -u or --user option) and password (with the -p
9
11
  # or --password option) are specified.
@@ -22,13 +24,13 @@
22
24
  # bind to LDAP without authorisation
23
25
  # ----------------------------------
24
26
  # ./check-syncrepl.rb -h 'ldap1.domain,ldap2.domain'
25
- # will compare the contextCSN of the ldap servers ldap1.domain and
27
+ # will compare the contextCSN of the LDAP servers ldap1.domain and
26
28
  # ldap2.domain
27
29
  #
28
30
  # bind to LDAP requiring authorisation
29
31
  # ------------------------------------
30
32
  # ./check-syncrepl.rb -h 'ldap1.domain,ldap2.domain' -u auser -p passwd
31
- # will bind to the ldap servers ldap1.domain and ldap2.domain as user
33
+ # will bind to the LDAP servers ldap1.domain and ldap2.domain as user
32
34
  # auser with password passwd and compare the contextCSN
33
35
  #
34
36
  # NOTES:
@@ -46,7 +48,7 @@ class CheckSyncrepl < Sensu::Plugin::Check::CLI
46
48
  option :hosts,
47
49
  short: '-h HOSTS',
48
50
  long: '--hosts HOSTS',
49
- description: 'Comma seperated list of hosts to compare',
51
+ description: 'Comma separated list of hosts to compare',
50
52
  required: true,
51
53
  proc: proc { |hosts| hosts.split(',') }
52
54
 
@@ -78,6 +80,23 @@ class CheckSyncrepl < Sensu::Plugin::Check::CLI
78
80
  long: '--insecure',
79
81
  description: 'Do not use encryption'
80
82
 
83
+ option :encryption,
84
+ short: '-e ENCRYPTION',
85
+ long: '--encryption ENCRYPTION',
86
+ description: 'Encryption method to use. Either simple_tls or start_tls',
87
+ default: nil,
88
+ proc: proc(&:to_sym)
89
+
90
+ option :cacert,
91
+ long: '--ca-certificate ENCRYPTION',
92
+ description: 'Trusted CA certificate for checking the endpoint validity',
93
+ default: nil
94
+
95
+ option :cert,
96
+ long: '--certificate ENCRYPTION',
97
+ description: 'Client certificate',
98
+ default: nil
99
+
81
100
  option :retries,
82
101
  short: '-r RETRIES',
83
102
  long: '--retries RETRIES',
@@ -99,8 +118,18 @@ class CheckSyncrepl < Sensu::Plugin::Check::CLI
99
118
  port: config[:port]
100
119
  end
101
120
 
102
- unless config[:insecure]
103
- ldap.encryption(method: :simple_tls)
121
+ unless (config[:insecure] && config[:encryption].nil?) || config[:encryption] == :none
122
+ config[:encryption] ||= :simple_tls
123
+ tls_options = {
124
+ verify_mode: (config[:insecure] ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER)
125
+ }
126
+ if config[:cacert]
127
+ tls_options[:ca_file] = config[:cacert]
128
+ end
129
+ if config[:cert]
130
+ tls_options[:cert] = open(config[:cert]) { |i| OpenSSL::X509::Certificate.new(i) }
131
+ end
132
+ ldap.encryption(method: config[:encryption], tls_options: tls_options)
104
133
  end
105
134
 
106
135
  begin
@@ -116,11 +145,12 @@ class CheckSyncrepl < Sensu::Plugin::Check::CLI
116
145
  critical message
117
146
  end
118
147
  end
119
- rescue
148
+ rescue => e
120
149
  message = "Cannot connect to #{host}:#{config[:port]}"
121
150
  if config[:user]
122
151
  message += " as #{config[:user]}"
123
152
  end
153
+ message += e.inspect
124
154
  critical message
125
155
  end
126
156
 
@@ -138,15 +168,15 @@ class CheckSyncrepl < Sensu::Plugin::Check::CLI
138
168
  @differences = []
139
169
  combinations = csns.keys.combination(2).to_a
140
170
  combinations.each do |hosts|
141
- @differences << hosts if (csns[hosts[0]] - csns[hosts[1]]).length > 0
171
+ @differences << hosts if (csns[hosts[0]] - csns[hosts[1]]).length > 0 # rubocop:disable Style/ZeroLengthPredicate
142
172
  end
143
173
 
144
174
  # If everything is OK, no need to retry
145
- ok 'All nodes are in sync' if @differences.length == 0
175
+ ok 'All nodes are in sync' if @differences.length == 0 # rubocop:disable Style/ZeroLengthPredicate
146
176
  end
147
177
 
148
178
  # Hit max retries, report latest differences
149
- message = 'ContextCSNs differe between: '
179
+ message = 'ContextCSNs differ between: '
150
180
 
151
181
  joined = []
152
182
  @differences.each do |different|
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsOpenldap
2
2
  module Version
3
- MAJOR = 0
3
+ MAJOR = 1
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,51 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-openldap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRIwEAYDVQQDDAltYXR0
14
- am9uZXMxGDAWBgoJkiaJk/IsZAEZFgh5aWVsZGJvdDETMBEGCgmSJomT8ixkARkW
15
- A2NvbTAeFw0xNTAxMjgyMTAyNTFaFw0xNjAxMjgyMTAyNTFaMEMxEjAQBgNVBAMM
16
- CW1hdHRqb25lczEYMBYGCgmSJomT8ixkARkWCHlpZWxkYm90MRMwEQYKCZImiZPy
17
- LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyTSzVYnO
18
- CLgyrIyT1mBQakArQyW8xhi6MlDqyzXHJGeERT790U6EgoBVeS4XoK0ptFZNR8Tf
19
- zko0w+Nv47TarSCgkPOaxY+mxWnAVR10dOmfeLr7huiMyps+YD56/EF2FqQ3jf/+
20
- qohENfKD91qy1ieEy+Fn7Pf74ltbNKUdkb9a9eFXQ0DQ4ip5vik7DzjQkUTj4lca
21
- k6ArwnmHX4YDhZoYtrQJ8jVktN0/+NtA40M5qkCYHNe5tUW25b/tKVYuioxG6b2Z
22
- oIzaZxRLxf6HVAWpCVRT/F5+/yjigkX4u++eYacfLGleXQzoK7BL65vHGMJygWEE
23
- 0TKGqFOrl/L0AQIDAQABo38wfTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
24
- HQ4EFgQUEf6a8Td7MrSZc8ImbLFZAENPbz0wIQYDVR0RBBowGIEWbWF0dGpvbmVz
25
- QHlpZWxkYm90LmNvbTAhBgNVHRIEGjAYgRZtYXR0am9uZXNAeWllbGRib3QuY29t
26
- MA0GCSqGSIb3DQEBBQUAA4IBAQBbzXAYA3BVGw8DZ0YYoY1VHPNEcH5qPIApmHO8
27
- rvSmuUT0yMEi7u00H/5uHRFf4LleGT/+sTdyXKsNPGT9kdRuQEgwi+vf7Zfvd8aX
28
- UF/+4VkEYf/8rV8Ere6u2QaWPgApdMV6JjKr1fAwCTd8AuGXNaWItiPPMseSQzLJ
29
- JKP4hVvbc1d+oS925B1lcBiqn2aYvElbyNAVmQPywNNqkWmvtlqj9ZVJfV5HQLdu
30
- 8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
- HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
- -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2017-01-18 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  name: sensu-plugin
37
15
  requirement: !ruby/object:Gem::Requirement
38
16
  requirements:
39
- - - '='
17
+ - - "~>"
40
18
  - !ruby/object:Gem::Version
41
- version: 1.2.0
19
+ version: '1.2'
42
20
  type: :runtime
43
21
  prerelease: false
44
22
  version_requirements: !ruby/object:Gem::Requirement
45
23
  requirements:
46
- - - '='
24
+ - - "~>"
47
25
  - !ruby/object:Gem::Version
48
- version: 1.2.0
26
+ version: '1.2'
49
27
  - !ruby/object:Gem::Dependency
50
28
  name: net-ldap
51
29
  requirement: !ruby/object:Gem::Requirement
@@ -61,136 +39,136 @@ dependencies:
61
39
  - !ruby/object:Gem::Version
62
40
  version: '0.11'
63
41
  - !ruby/object:Gem::Dependency
64
- name: codeclimate-test-reporter
42
+ name: bundler
65
43
  requirement: !ruby/object:Gem::Requirement
66
44
  requirements:
67
45
  - - "~>"
68
46
  - !ruby/object:Gem::Version
69
- version: '0.4'
47
+ version: '1.7'
70
48
  type: :development
71
49
  prerelease: false
72
50
  version_requirements: !ruby/object:Gem::Requirement
73
51
  requirements:
74
52
  - - "~>"
75
53
  - !ruby/object:Gem::Version
76
- version: '0.4'
54
+ version: '1.7'
77
55
  - !ruby/object:Gem::Dependency
78
- name: rubocop
56
+ name: codeclimate-test-reporter
79
57
  requirement: !ruby/object:Gem::Requirement
80
58
  requirements:
81
- - - '='
59
+ - - "~>"
82
60
  - !ruby/object:Gem::Version
83
- version: '0.30'
61
+ version: '0.4'
84
62
  type: :development
85
63
  prerelease: false
86
64
  version_requirements: !ruby/object:Gem::Requirement
87
65
  requirements:
88
- - - '='
66
+ - - "~>"
89
67
  - !ruby/object:Gem::Version
90
- version: '0.30'
68
+ version: '0.4'
91
69
  - !ruby/object:Gem::Dependency
92
- name: rspec
70
+ name: github-markup
93
71
  requirement: !ruby/object:Gem::Requirement
94
72
  requirements:
95
73
  - - "~>"
96
74
  - !ruby/object:Gem::Version
97
- version: '3.1'
75
+ version: '1.3'
98
76
  type: :development
99
77
  prerelease: false
100
78
  version_requirements: !ruby/object:Gem::Requirement
101
79
  requirements:
102
80
  - - "~>"
103
81
  - !ruby/object:Gem::Version
104
- version: '3.1'
82
+ version: '1.3'
105
83
  - !ruby/object:Gem::Dependency
106
- name: bundler
84
+ name: pry
107
85
  requirement: !ruby/object:Gem::Requirement
108
86
  requirements:
109
87
  - - "~>"
110
88
  - !ruby/object:Gem::Version
111
- version: '1.7'
89
+ version: '0.10'
112
90
  type: :development
113
91
  prerelease: false
114
92
  version_requirements: !ruby/object:Gem::Requirement
115
93
  requirements:
116
94
  - - "~>"
117
95
  - !ruby/object:Gem::Version
118
- version: '1.7'
96
+ version: '0.10'
119
97
  - !ruby/object:Gem::Dependency
120
98
  name: rake
121
99
  requirement: !ruby/object:Gem::Requirement
122
100
  requirements:
123
101
  - - "~>"
124
102
  - !ruby/object:Gem::Version
125
- version: '10.0'
103
+ version: '10.5'
126
104
  type: :development
127
105
  prerelease: false
128
106
  version_requirements: !ruby/object:Gem::Requirement
129
107
  requirements:
130
108
  - - "~>"
131
109
  - !ruby/object:Gem::Version
132
- version: '10.0'
110
+ version: '10.5'
133
111
  - !ruby/object:Gem::Dependency
134
- name: github-markup
112
+ name: redcarpet
135
113
  requirement: !ruby/object:Gem::Requirement
136
114
  requirements:
137
115
  - - "~>"
138
116
  - !ruby/object:Gem::Version
139
- version: '1.3'
117
+ version: '3.2'
140
118
  type: :development
141
119
  prerelease: false
142
120
  version_requirements: !ruby/object:Gem::Requirement
143
121
  requirements:
144
122
  - - "~>"
145
123
  - !ruby/object:Gem::Version
146
- version: '1.3'
124
+ version: '3.2'
147
125
  - !ruby/object:Gem::Dependency
148
- name: redcarpet
126
+ name: rubocop
149
127
  requirement: !ruby/object:Gem::Requirement
150
128
  requirements:
151
129
  - - "~>"
152
130
  - !ruby/object:Gem::Version
153
- version: '3.2'
131
+ version: 0.40.0
154
132
  type: :development
155
133
  prerelease: false
156
134
  version_requirements: !ruby/object:Gem::Requirement
157
135
  requirements:
158
136
  - - "~>"
159
137
  - !ruby/object:Gem::Version
160
- version: '3.2'
138
+ version: 0.40.0
161
139
  - !ruby/object:Gem::Dependency
162
- name: yard
140
+ name: rspec
163
141
  requirement: !ruby/object:Gem::Requirement
164
142
  requirements:
165
143
  - - "~>"
166
144
  - !ruby/object:Gem::Version
167
- version: '0.8'
145
+ version: '3.4'
168
146
  type: :development
169
147
  prerelease: false
170
148
  version_requirements: !ruby/object:Gem::Requirement
171
149
  requirements:
172
150
  - - "~>"
173
151
  - !ruby/object:Gem::Version
174
- version: '0.8'
152
+ version: '3.4'
175
153
  - !ruby/object:Gem::Dependency
176
- name: pry
154
+ name: yard
177
155
  requirement: !ruby/object:Gem::Requirement
178
156
  requirements:
179
157
  - - "~>"
180
158
  - !ruby/object:Gem::Version
181
- version: '0.10'
159
+ version: '0.8'
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
163
  requirements:
186
164
  - - "~>"
187
165
  - !ruby/object:Gem::Version
188
- version: '0.10'
189
- description: Sensu plugins for openldap
166
+ version: '0.8'
167
+ description: Sensu plugins for OpenLDAP
190
168
  email: "<sensu-users@googlegroups.com>"
191
169
  executables:
192
- - metrics-ldap.rb
193
170
  - check-syncrepl.rb
171
+ - metrics-ldap.rb
194
172
  extensions: []
195
173
  extra_rdoc_files: []
196
174
  files:
@@ -205,7 +183,7 @@ homepage: https://github.com/sensu-plugins/sensu-plugins-openldap
205
183
  licenses:
206
184
  - MIT
207
185
  metadata:
208
- maintainer: "@tas50"
186
+ maintainer: sensu-plugin
209
187
  development_status: active
210
188
  production_status: unstable - testing recommended
211
189
  release_draft: 'false'
@@ -219,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
197
  requirements:
220
198
  - - ">="
221
199
  - !ruby/object:Gem::Version
222
- version: 1.9.3
200
+ version: 2.1.0
223
201
  required_rubygems_version: !ruby/object:Gem::Requirement
224
202
  requirements:
225
203
  - - ">="
@@ -227,8 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
205
  version: '0'
228
206
  requirements: []
229
207
  rubyforge_project:
230
- rubygems_version: 2.4.6
208
+ rubygems_version: 2.4.5
231
209
  signing_key:
232
210
  specification_version: 4
233
- summary: Sensu plugins for openldap
211
+ summary: Sensu plugins for OpenLDAP
234
212
  test_files: []
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
Binary file