sensu-plugins-kafka 0.5.1 → 0.6.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
2
  SHA1:
3
- metadata.gz: 14289cc6fa00585ad4b815682a03333b7846ec80
4
- data.tar.gz: 28c650585353855cc65b8159cd66b7148357c313
3
+ metadata.gz: e931ad3727c1fecdc9d803a89863cc0075c57007
4
+ data.tar.gz: 7cbcfb5d1867091cd18890f1bc37ac9ce40644fd
5
5
  SHA512:
6
- metadata.gz: 46fc9b7f89c91ed3ad0b771045d9febe08cc914c0ba7354cb75e90788979a3f7a6ace4144db6c74a9792e28cf820fc787baa4c294445ccd876bd5d3012256dc9
7
- data.tar.gz: 9ea64f7a88a6ec4760b3d04c8255709f2a57159fc2529c75ee27044006e4ff3612d6e174aa95e833947eae50414c60b7a63f9b95ef4166235c65c0856ca255cd
6
+ metadata.gz: d2b11c03a7b6d8fb8da630992a5bfd3344a79dc85960533c5ea941a5e9ebd73ecad182e24932c610ac8d8aa52cf8c8f5e5642c7b7746cb8c8ca95f7f92bdf8e2
7
+ data.tar.gz: 817e695fb3fc8eb4db1b23355c14f796db9839e736114c22eed0efb2fb15b27f8c81f484c5cf3f9a61a9a1cf2933f5e0ffafd8d8c98d126697857a637b6e44e9
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.6.0] - 2017-02-10
14
+
15
+ ### Added
16
+ - Add check-topics-name.rb
17
+
13
18
  ## [0.5.1] - 2017-02-10
14
19
 
15
20
  ### Fixed
data/README.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  **check-topic.rb**
10
10
 
11
+ **check-topics-name.rb**
12
+
11
13
  **metrics-consumer.rb**
12
14
 
13
15
  ## Files
@@ -20,4 +22,6 @@
20
22
 
21
23
  Kafka installation is required where checks will be made.
22
24
 
25
+ Kafka version: 0.8.2.x
26
+
23
27
  Note: In addition to the standard installation requirements the installation of this gem will require compiling the nokogiri gem. Due to this you'll need certain developmemnt packages on your system. On Ubuntu systems install build-essential, libxml2-dev and zlib1g-dev. On CentOS install gcc and zlib-devel.
@@ -0,0 +1,61 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-topics-name
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin checks topic's name.
7
+ #
8
+ # OUTPUT:
9
+ # plain-text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ # gem: zookeeper
17
+ #
18
+ # USAGE:
19
+ # ./check-topics-name
20
+ #
21
+ # NOTES:
22
+ #
23
+ # LICENSE:
24
+ # Olivier Bazoud
25
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
26
+ # for details.
27
+ #
28
+
29
+ require 'sensu-plugin/check/cli'
30
+ require 'json'
31
+ require 'zookeeper'
32
+
33
+ class TopicsCheck < Sensu::Plugin::Check::CLI
34
+ option :zookeeper,
35
+ description: 'ZooKeeper connect string (host:port,..)',
36
+ short: '-z ZOOKEEPER',
37
+ long: '--zookeeper ZOOKEEPER',
38
+ default: 'localhost:2181',
39
+ required: true
40
+
41
+ option :name,
42
+ description: 'Topic name',
43
+ short: '-n TOPIC_NAME',
44
+ long: '--name TOPIC_NAME',
45
+ proc: proc { |a| a.split(',') },
46
+ required: true
47
+
48
+ def run
49
+ z = Zookeeper.new(config[:zookeeper])
50
+
51
+ topics = z.get_children(path: '/brokers/topics')[:children].sort
52
+
53
+ critical "Topics '#{config[:name] - topics}' not found" if (config[:name] - topics).empty?
54
+ critical "Topics '#{topics - config[:name]}' not checked" if (topics - config[:name]).empty?
55
+
56
+ ok
57
+ rescue => e
58
+ puts "Error: #{e.backtrace}"
59
+ critical "Error: #{e}"
60
+ end
61
+ end
@@ -5,8 +5,8 @@ module SensuPluginsKafka
5
5
  # This defines the version of the gem
6
6
  module Version
7
7
  MAJOR = 0
8
- MINOR = 5
9
- PATCH = 1
8
+ MINOR = 6
9
+ PATCH = 0
10
10
 
11
11
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
12
12
  end
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.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
@@ -170,6 +170,7 @@ email: "<sensu-users@googlegroups.com>"
170
170
  executables:
171
171
  - check-consumer-lag.rb
172
172
  - check-topic.rb
173
+ - check-topics-name.rb
173
174
  - metrics-consumer.rb
174
175
  extensions: []
175
176
  extra_rdoc_files: []
@@ -179,6 +180,7 @@ files:
179
180
  - README.md
180
181
  - bin/check-consumer-lag.rb
181
182
  - bin/check-topic.rb
183
+ - bin/check-topics-name.rb
182
184
  - bin/metrics-consumer.rb
183
185
  - lib/sensu-plugins-kafka.rb
184
186
  - lib/sensu-plugins-kafka/version.rb