sensu-plugins-dns 1.2.2 → 1.3.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
- SHA1:
3
- metadata.gz: 04de69f62fceffef428d0dbfd808175c3345cc3f
4
- data.tar.gz: e6e603aacc565fabbe5f0226ba73d07601dae498
2
+ SHA256:
3
+ metadata.gz: 3c4a1a4584123303d29aa528f66076f41cf91b9ea1158e4dcb1ccb2cb83692c6
4
+ data.tar.gz: bdef1db7617e2bef6e563118c5dde7fdd35a9491f36b48a2012e85d4cbcd4be0
5
5
  SHA512:
6
- metadata.gz: da571571bc2abc66d212f9f69d9a3df7da2356308be9daf2038d7cc0deaace3a4f0e44484a90f7b3a8c306ff47efbad5efdbeab44dd6c9c40ec6fecff35be903
7
- data.tar.gz: 137ece15b830e42740754e89b5ff173721c31448bdce91d2c1ecbe6b824c675ce0568176d973803ff8c5c6564a1be70e6fcef2917bf2f6cbf2594a1922e8ee0e
6
+ metadata.gz: 5a2f3339c209eb1980f2261cc7674f40160b3d54cf72e83e3edd03d5c19f1d15ecfa7ad3e924d28613149baba83b3f1323ebd64a944ad65b66b6474c6f8a4ff9
7
+ data.tar.gz: f8088ee883af1e38e7d89c6fedc4fa0c89ee87b2931d14e96a2a156f542e46d856f947a4220d1f3816af1e195ac1f588578a1e28788515d534817fcf9e2c665a
data/CHANGELOG.md CHANGED
@@ -1,10 +1,21 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.3.0] - 2017-11-04
9
+ ### Added
10
+ - Support for multiple resolvable ips (comma separated). (@adamdecaf)
11
+ - integration testing with `test-kitchen`, `kitchen-docker`, etc (@majormoses)
12
+
13
+ ### Changed
14
+ - update changelog guidelines location (@majormoses)
15
+
16
+ ### Removed
17
+ - removed ruby 2.0 testing (@majormoses)
18
+
8
19
  ## [1.2.2] - 2017-07-15
9
20
  ### Fixed
10
21
  - check-dns.rb: fixed a bug reported in #23 regarding an undefined variable only triggered when using the `--validate` flag. (@majormoses)
@@ -66,6 +77,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
66
77
  - removed cruft from /lib
67
78
 
68
79
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.2.1...HEAD
80
+ [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.2.1...1.3.0
69
81
  [1.2.1]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.2.0...1/1.2.1
70
82
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.1.0...1/1.2
71
83
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.0.0...1/1.0
data/bin/check-dns.rb CHANGED
@@ -65,7 +65,7 @@ class DNS < Sensu::Plugin::Check::CLI
65
65
  proc: proc(&:to_i)
66
66
 
67
67
  option :result,
68
- description: 'A positive result entry',
68
+ description: 'A list of positive result entries (comma separated list)',
69
69
  short: '-r RESULT',
70
70
  long: '--result RESULT'
71
71
 
@@ -162,7 +162,8 @@ class DNS < Sensu::Plugin::Check::CLI
162
162
  errors = []
163
163
  success = []
164
164
 
165
- entries.each do |entry|
165
+ # TODO: come back and refactor
166
+ entries.each do |entry| # rubocop:disable Metrics/BlockLength
166
167
  if entry.class == Dnsruby::NXDomain
167
168
  errors << "Could not resolve #{config[:domain]} #{config[:type]} record"
168
169
  next
@@ -190,7 +191,7 @@ class DNS < Sensu::Plugin::Check::CLI
190
191
  else
191
192
  entry.answer.first.to_s
192
193
  end
193
- if b.include?(config[:result])
194
+ if config[:result].split(',').any? { |r| b.include?(r) }
194
195
  success << "Resolved #{entry.security_level} #{config[:domain]} #{config[:type]} included #{config[:result]}"
195
196
  else
196
197
  errors << "Resolved #{config[:domain]} #{config[:type]} did not include #{config[:result]}"
@@ -213,8 +214,11 @@ class DNS < Sensu::Plugin::Check::CLI
213
214
 
214
215
  def check_ips(entries)
215
216
  ips = entries.first.answer.rrsets(config[:type]).flat_map(&:rrs).map(&:address).map(&:to_s)
216
- result = IPAddr.new config[:result]
217
- if ips.any? { |ip| (IPAddr.new ip) == result }
217
+ results = config[:result].split(',').map { |r| IPAddr.new(r) }
218
+ found = results.any? do |result|
219
+ ips.any? { |ip| IPAddr.new(ip) == result }
220
+ end
221
+ if found
218
222
  ok "Resolved #{entries.first.security_level} #{config[:domain]} #{config[:type]} included #{config[:result]}"
219
223
  else
220
224
  critical "Resolved #{config[:domain]} #{config[:type]} did not include #{config[:result]}"
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsDNS
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 2
5
- PATCH = 2
4
+ MINOR = 3
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-dns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.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: 2017-07-15 00:00:00.000000000 Z
11
+ date: 2017-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: dnsruby
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -45,47 +59,81 @@ dependencies:
45
59
  - !ruby/object:Gem::Version
46
60
  version: 1.59.2
47
61
  - !ruby/object:Gem::Dependency
48
- name: bundler
62
+ name: codeclimate-test-reporter
49
63
  requirement: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
- version: '1.7'
67
+ version: '0.4'
54
68
  type: :development
55
69
  prerelease: false
56
70
  version_requirements: !ruby/object:Gem::Requirement
57
71
  requirements:
58
72
  - - "~>"
59
73
  - !ruby/object:Gem::Version
60
- version: '1.7'
74
+ version: '0.4'
61
75
  - !ruby/object:Gem::Dependency
62
- name: codeclimate-test-reporter
76
+ name: github-markup
63
77
  requirement: !ruby/object:Gem::Requirement
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: '0.4'
81
+ version: '1.3'
68
82
  type: :development
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '0.4'
88
+ version: '1.3'
75
89
  - !ruby/object:Gem::Dependency
76
- name: github-markup
90
+ name: kitchen-docker
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '1.3'
95
+ version: '2.6'
82
96
  type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '1.3'
102
+ version: '2.6'
103
+ - !ruby/object:Gem::Dependency
104
+ name: kitchen-localhost
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.3'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.3'
117
+ - !ruby/object:Gem::Dependency
118
+ name: mixlib-shellout
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "<"
122
+ - !ruby/object:Gem::Version
123
+ version: 2.3.0
124
+ - - "~>"
125
+ - !ruby/object:Gem::Version
126
+ version: '2.2'
127
+ type: :development
128
+ prerelease: false
129
+ version_requirements: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - "<"
132
+ - !ruby/object:Gem::Version
133
+ version: 2.3.0
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '2.2'
89
137
  - !ruby/object:Gem::Dependency
90
138
  name: pry
91
139
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +196,28 @@ dependencies:
148
196
  requirements:
149
197
  - - "~>"
150
198
  - !ruby/object:Gem::Version
151
- version: 0.40.0
199
+ version: 0.49.0
200
+ type: :development
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - "~>"
205
+ - !ruby/object:Gem::Version
206
+ version: 0.49.0
207
+ - !ruby/object:Gem::Dependency
208
+ name: test-kitchen
209
+ requirement: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - "~>"
212
+ - !ruby/object:Gem::Version
213
+ version: 1.16.0
152
214
  type: :development
153
215
  prerelease: false
154
216
  version_requirements: !ruby/object:Gem::Requirement
155
217
  requirements:
156
218
  - - "~>"
157
219
  - !ruby/object:Gem::Version
158
- version: 0.40.0
220
+ version: 1.16.0
159
221
  - !ruby/object:Gem::Dependency
160
222
  name: yard
161
223
  requirement: !ruby/object:Gem::Requirement
@@ -213,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
275
  version: '0'
214
276
  requirements: []
215
277
  rubyforge_project:
216
- rubygems_version: 2.4.5
278
+ rubygems_version: 2.7.1
217
279
  signing_key:
218
280
  specification_version: 4
219
281
  summary: Sensu plugins for dns