Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JMX URL #3

Open
chrisjschultz opened this issue Mar 19, 2015 · 0 comments
Open

Support for JMX URL #3

chrisjschultz opened this issue Mar 19, 2015 · 0 comments

Comments

@chrisjschultz
Copy link

I am using your most excellent plugin with JBoss Fuse/Karaf.

Unfortunately, I cannot use the code directly, it requires some modification. Karaf has a specific URL syntax required to connect, using host and port does not work.

@logger.debug('Check if jmx connection need a user/password')
        if thread_hash_conf.has_key?('username') and thread_hash_conf.has_key?('password')
          @logger.debug("Connect to #{thread_hash_conf['host']}:#{thread_hash_conf['port']} with user #{thread_hash_conf['username']}")
          jmx_connection = JMX::MBean.connection :host => thread_hash_conf['host'],
                                                 :port => thread_hash_conf['port'],
                                                 :url => thread_hash_conf['url'],
                                                 :username => thread_hash_conf['username'],
                                                 :password => thread_hash_conf['password']

I simply added the option to pass url in from the JMX configuration file. This overrides the host and port and they are ignored by jmx4r, so more work could be done to NOT require host and port in the config if URL is provided. An example config that works is shown below.

{
  "host" : "localhost",
  "port" : 1100,
  "url"  : "service:jmx:rmi://server:44444/jndi/rmi://server:1099/karaf-root",
  "username" : "admin",
  "password": "admin",
  "alias" : "chris",
  "queries" : [...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant