Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to monitor JMX metrics of Kafka broker on command line?

A Kafka cluster can be monitored in granular detail via the JMX metrics it exposes. Usually an external GUI or application like jconsole needs to be hooked up to a broker's exposed JMX_PORT in order to view these metrics.

Is there a way that I can view a broker's JMX metrics in an SSH session, via STDOUT? Is there a native Kafka command that I can run to view these metrics?

like image 341
Cole Bittel Avatar asked Jan 19 '17 22:01

Cole Bittel


1 Answers

Download the jar located here:

https://sourceforge.net/projects/cyclops-group/files/jmxterm/1.0-alpha-4/

On the machine, then run:

wget https://sourceforge.net/projects/cyclops-group/files/jmxterm/1.0-alpha-4/ -o jmxterm.jar

java -jar jmxterm.jar

>open localhost:$jmx_port

Help will give you what you need after that :)

Save this jar somewhere useful, I use it nearly every day.

like image 169
Marc Murray Avatar answered Oct 22 '22 11:10

Marc Murray