sensu-plugins-kafka 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/check-topic.rb +5 -3
- 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: 10e9d48ba8a90c446cc5ba9b82d027e6fb55ddfc
|
4
|
+
data.tar.gz: bdd9251b41653a0a990a68b199bac4aba92b53ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6227b504aeaccb43e9ae87bba56e1f86508d2376c76022d1ee20c0237c762aad8a74fdcfc09923ef7625b72edadbb959fa02b3269810e5e64e79982a9847a9f5
|
7
|
+
data.tar.gz: 78da58aad700bda5ad6a8e656d5451360188303d0cd6e2b93fcb8f4ea1efb32f83c8f1887086d37e217ce14708a961da97c7d633ba70d9e848bc51948062b3c4
|
data/bin/check-topic.rb
CHANGED
@@ -35,19 +35,21 @@ class TopicsCheck < Sensu::Plugin::Check::CLI
|
|
35
35
|
description: 'ZooKeeper connect string (host:port,..)',
|
36
36
|
short: '-z ZOOKEEPER',
|
37
37
|
long: '--zookeeper ZOOKEEPER',
|
38
|
-
default: 'localhost:2181'
|
38
|
+
default: 'localhost:2181',
|
39
|
+
required: true
|
39
40
|
|
40
41
|
option :name,
|
41
42
|
description: 'Topic name',
|
42
43
|
short: '-n TOPIC_NAME',
|
43
|
-
long: '--name TOPIC_NAME'
|
44
|
+
long: '--name TOPIC_NAME',
|
45
|
+
required: true
|
44
46
|
|
45
47
|
def run
|
46
48
|
z = Zookeeper.new(config[:zookeeper])
|
47
49
|
|
48
50
|
live_topics = z.get_children(path: '/brokers/topics')[:children].sort
|
49
51
|
|
50
|
-
critical "#{
|
52
|
+
critical "#{config[:name]} not found" unless live_topics.include? config[:name]
|
51
53
|
|
52
54
|
ok
|
53
55
|
rescue => e
|