I am writing a shell script to monitor kafka brokers.
I have gone through some links and found that if ZooKeeper contains a list of brokers, and if, in this list, th
I did it like this
#!/bin/bash ZK_HOST="localhost" ZK_PORT=2181 for i in `echo dump | nc $ZK_HOST $ZK_PORT | grep brokers` do echo $i DETAIL=`zkCli -server "$ZK_HOST:$ZK_PORT" get $i 2>/dev/null | tail -n 1` echo $DETAIL done