sensu-plugins-kafka 0.3.0 → 0.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 +5 -0
- data/bin/check-topic.rb +14 -0
- data/lib/sensu-plugins-kafka/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f15af24fc4ac6106a1ddee9d37d87199d837407b
|
4
|
+
data.tar.gz: 29581c610cd42e174b6c0fe257ee7c59cf8142b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8933c4674ecbb29b96f1fe619793ee4e73027e82fe3f3c53711ed4c9c53e0eada1f53aa92298ba424b06b7a378bd97103999e51372845ba74db7dc21c0b530c
|
7
|
+
data.tar.gz: 3fea1a9d4451727842d13c8189484307910c3376d1e60c656e8438328816077caa2a3aa69a6afd0a3eae98ead90809566cc669c515296e89bdaf5d9be1be30de
|
data/CHANGELOG.md
CHANGED
data/bin/check-topic.rb
CHANGED
@@ -56,6 +56,12 @@ class TopicsCheck < Sensu::Plugin::Check::CLI
|
|
56
56
|
long: '--replication-factor REPLICATION_FACTOR',
|
57
57
|
proc: proc(&:to_i)
|
58
58
|
|
59
|
+
option :configs,
|
60
|
+
description: 'Topic configurations',
|
61
|
+
short: '-c CONFIG',
|
62
|
+
long: '--configs CONFIG',
|
63
|
+
proc: proc { |a| JSON.parse(a) }
|
64
|
+
|
59
65
|
def run
|
60
66
|
z = Zookeeper.new(config[:zookeeper])
|
61
67
|
|
@@ -74,6 +80,14 @@ class TopicsCheck < Sensu::Plugin::Check::CLI
|
|
74
80
|
max = partitions.max_by { |_, brokers| brokers.size }[1].length
|
75
81
|
critical "Topic '#{config[:name]}' RF is between #{min} and #{max}, expecting #{config[:replication_factor]}" if config[:replication_factor] != min || min != max
|
76
82
|
end
|
83
|
+
|
84
|
+
if config.key?(:configs)
|
85
|
+
config_data = z.get(path: "/config/topics/#{config[:name]}")[:data]
|
86
|
+
configs = JSON.parse(config_data)['config']
|
87
|
+
config[:configs].each do |k, v|
|
88
|
+
critical "Topic '#{config[:name]}': config #{k} is /#{v}, expecting #{configs[k]}" if !configs.key?(k) || configs[k].to_s != v.to_s
|
89
|
+
end
|
90
|
+
end
|
77
91
|
end
|
78
92
|
ok
|
79
93
|
rescue => e
|