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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +4 -0
- data/bin/check-topics-name.rb +61 -0
- data/lib/sensu-plugins-kafka/version.rb +2 -2
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e931ad3727c1fecdc9d803a89863cc0075c57007
|
4
|
+
data.tar.gz: 7cbcfb5d1867091cd18890f1bc37ac9ce40644fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2b11c03a7b6d8fb8da630992a5bfd3344a79dc85960533c5ea941a5e9ebd73ecad182e24932c610ac8d8aa52cf8c8f5e5642c7b7746cb8c8ca95f7f92bdf8e2
|
7
|
+
data.tar.gz: 817e695fb3fc8eb4db1b23355c14f796db9839e736114c22eed0efb2fb15b27f8c81f484c5cf3f9a61a9a1cf2933f5e0ffafd8d8c98d126697857a637b6e44e9
|
data/CHANGELOG.md
CHANGED
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
|
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.
|
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
|