Last active
November 26, 2019 16:47
-
-
Save jazzl0ver/856cf99ac7183e22f5b5cdfce09e4cb3 to your computer and use it in GitHub Desktop.
Nagios plugin to check Kafka for under replicated partitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Nagios plugin to check Apache Kafka for under replicated partitions | |
# Zookeeper comma separated addresses are required as a 1st parameter | |
# | |
# https://gist.github.com/jazzl0ver | |
# | |
ZK=$1 | |
count=$(/bin/docker run --rm --entrypoint /bin/bash -e KAFKA_HEAP_OPTS="-Xmx128M" jazzl0ver/firecamp-kafka:2.3 /kafka/bin/kafka-topics.sh --zookeeper "$ZK" --describe --under-replicated-partitions | wc -l) | |
if [ $count -eq 0 ]; then | |
echo "OK: no under replicated partitions found | count=$count" | |
exit 0 | |
else | |
echo "WARNING: $count under replicated partitions found | count=$count" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment