sensu-plugins-dns 1.3.0 → 1.4.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 +4 -4
- data/CHANGELOG.md +6 -1
- data/bin/check-dns.rb +16 -6
- data/lib/sensu-plugins-dns/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53a429e24b6cdf656b6e77bf0029e665d140c74efef5cf62dd9cbd36745c5dfb
|
4
|
+
data.tar.gz: a84326254d63f448522ea399c1f1ea511424db4b20ba3fc237a760aeeead905c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bab8fa874b28fab41648b1ab3c19fd0f7876e944abbc9a1d50840f57ba91fdaf07bb27497d3fccbca185b06ac4e50d97c25f465135f1fb7f60a222061f6e20a
|
7
|
+
data.tar.gz: 156d4f4a21c48cb9fa08add6b340f8162ff654fe8fcf8d981d10267dbbecc24d048893a6617a52dfa43df7ec209ff6137630478d2d95b238efa34a73ff346dd0
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.4.0] - 2018-03-21
|
9
|
+
### Added
|
10
|
+
- check-dns.rb: Added ability to use many name servers (@yuri-zubov)
|
11
|
+
|
8
12
|
## [1.3.0] - 2017-11-04
|
9
13
|
### Added
|
10
14
|
- Support for multiple resolvable ips (comma separated). (@adamdecaf)
|
@@ -76,7 +80,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
76
80
|
### Changed
|
77
81
|
- removed cruft from /lib
|
78
82
|
|
79
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.
|
83
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.4.0...HEAD
|
84
|
+
[1.4.0]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.3.0...1.4.0
|
80
85
|
[1.3.0]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.2.1...1.3.0
|
81
86
|
[1.2.1]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.2.0...1/1.2.1
|
82
87
|
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-dns/compare/1.1.0...1/1.2
|
data/bin/check-dns.rb
CHANGED
@@ -54,7 +54,7 @@ class DNS < Sensu::Plugin::Check::CLI
|
|
54
54
|
default: 'IN'
|
55
55
|
|
56
56
|
option :server,
|
57
|
-
description: '
|
57
|
+
description: 'A comma-separated list of servers to use for resolution',
|
58
58
|
short: '-s SERVER',
|
59
59
|
long: '--server SERVER'
|
60
60
|
|
@@ -118,9 +118,10 @@ class DNS < Sensu::Plugin::Check::CLI
|
|
118
118
|
proc: proc(&:to_i),
|
119
119
|
default: 5
|
120
120
|
|
121
|
-
def resolve_domain
|
121
|
+
def resolve_domain(server)
|
122
122
|
dnsruby_config = {}
|
123
|
-
|
123
|
+
|
124
|
+
dnsruby_config[:nameserver] = server unless server.nil?
|
124
125
|
dnsruby_config[:port] = config[:port] unless config[:port].nil?
|
125
126
|
dnsruby_config[:use_tcp] = config[:use_tcp] unless config[:use_tcp].nil?
|
126
127
|
resolv = Dnsruby::Resolver.new(dnsruby_config)
|
@@ -229,10 +230,19 @@ class DNS < Sensu::Plugin::Check::CLI
|
|
229
230
|
unknown 'No domain specified' if config[:domain].nil?
|
230
231
|
unknown 'Count must be 1 or more' if config[:request_count] < 1
|
231
232
|
|
232
|
-
|
233
|
-
errors
|
233
|
+
success = []
|
234
|
+
errors = []
|
235
|
+
|
236
|
+
ns = config[:server].nil? ? [nil] : config[:server].split(',')
|
237
|
+
ns.each do |server|
|
238
|
+
entries = resolve_domain(server)
|
239
|
+
e, s = check_results(entries)
|
240
|
+
|
241
|
+
success += s
|
242
|
+
errors += e
|
243
|
+
end
|
234
244
|
|
235
|
-
percent = success.count.to_f / config[:request_count] * 100
|
245
|
+
percent = success.count.to_f / (config[:request_count] * ns.count) * 100
|
236
246
|
if percent < config[:threshold]
|
237
247
|
output = "#{percent.to_i}% of tests succeeded: #{errors.uniq.join(', ')}"
|
238
248
|
config[:warn_only] ? warning(output) : critical(output)
|
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.
|
4
|
+
version: 1.4.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:
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -237,8 +237,8 @@ description: |-
|
|
237
237
|
for monitoring, including: record resolution
|
238
238
|
email: "<sensu-users@googlegroups.com>"
|
239
239
|
executables:
|
240
|
-
- check-dns.rb
|
241
240
|
- metrics-dns.rb
|
241
|
+
- check-dns.rb
|
242
242
|
extensions: []
|
243
243
|
extra_rdoc_files: []
|
244
244
|
files:
|
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
275
|
version: '0'
|
276
276
|
requirements: []
|
277
277
|
rubyforge_project:
|
278
|
-
rubygems_version: 2.7.
|
278
|
+
rubygems_version: 2.7.6
|
279
279
|
signing_key:
|
280
280
|
specification_version: 4
|
281
281
|
summary: Sensu plugins for dns
|