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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e93ec2a07046094f7f0c1915b3b202743904694
4
- data.tar.gz: 0c32ad6b95b36144ff864a9615cae8f8dc44186f
3
+ metadata.gz: f15af24fc4ac6106a1ddee9d37d87199d837407b
4
+ data.tar.gz: 29581c610cd42e174b6c0fe257ee7c59cf8142b6
5
5
  SHA512:
6
- metadata.gz: 1911daa3cc089954f3e3042110bae2a7ca6e42443841d77f6f46ba02120d12f7ef8f98d9478edef0246019be592c8c2172d3704844a33dad192f63a8b8f7d9df
7
- data.tar.gz: 9a683432a3fb1d69b0e840c8b629b40e37962cf964ca3ff13df6ce3e8f227c9a3bd8284f69823a2081454bb143d7af94245d1098f73ba1651170485ac9e8c128
6
+ metadata.gz: f8933c4674ecbb29b96f1fe619793ee4e73027e82fe3f3c53711ed4c9c53e0eada1f53aa92298ba424b06b7a378bd97103999e51372845ba74db7dc21c0b530c
7
+ data.tar.gz: 3fea1a9d4451727842d13c8189484307910c3376d1e60c656e8438328816077caa2a3aa69a6afd0a3eae98ead90809566cc669c515296e89bdaf5d9be1be30de
data/CHANGELOG.md CHANGED
@@ -10,6 +10,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
10
10
  ### Fixed
11
11
  ### Changed
12
12
 
13
+ ## [0.4.0] - 2017-02-09
14
+
15
+ ### Added
16
+ - Add option to check topic's config
17
+
13
18
  ## [0.3.0] - 2017-02-09
14
19
 
15
20
  ### Added
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
@@ -5,7 +5,7 @@ module SensuPluginsKafka
5
5
  # This defines the version of the gem
6
6
  module Version
7
7
  MAJOR = 0
8
- MINOR = 3
8
+ MINOR = 4
9
9
  PATCH = 0
10
10
 
11
11
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors