2 Replies Latest reply on Jun 23, 2017 7:08 AM by Tulio Camminati

    Using jmx to get metrics for logstash (elk)

    Tulio Camminati Newbie

      Hi all,


      I am trying to get logstash to get get VM metrics from  Wildfly 10 using jmx :



      • Wildfly running standalone on a VM on
      • ELK running on a VM on (see my ELK-Vagrant config on github).
      • I'm using a plugin called logstash-input-jmx for logstash, from what I hear works well.
      • All ports are exported, so can see (tested with curl), specially port 9990 where jmx is on.
      • I can connect to Wildfly using the  jconsole on the URL `service:jmx:remote+http://localhost:9990` or using the deprecated URL-style: `service:jmx:http-remoting-jmx://localhost:9990` (will complain at the beginning though).



      • when using one of those URLs, logstash complains that the protocol is not supported.
      • when using only the host and the port (which is what is recommended) or using `service:jmx:rmi:///jndi/rmi://`it complains:

      [2017-06-22T17:31:10,755][ERROR][logstash.inputs.jmx] Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:

              java.net.SocketTimeoutException: Read timed out]

      [2017-06-22T17:31:10,756][ERROR][logstash.inputs.jmx      ] javax.management.remote.rmi.RMIConnector.connect(javax/management/remote/rmi/RMIConnector.java:369)









      Which means to me, that they are not speaking the right protocol. Since I get Jconsole to connect to the VM, I assume, that logstash.inputs.jmx is using a different protocol (when it obviously hates the URL-Styles above). So how should the URL look like?


      Another possibility is, that I am missing something in the Java side, since the Jconsole only works when jboss-cli-client.jar is in the class path (as you probably know).  It could be possible, that there is some vendor magic involved?


      Any other Ideas?


      If you want to try the ELK-environment yourself, feel free to try my container from the link above, you'll need Vagrant and VirtualBox and up you go. You just could use the Dockerfile whithout Vagrant if you prefer Docker (scripts are included).