gohopper / jmxquery

Automatically exported from code.google.com/p/jmxquery
0 stars 0 forks source link

JMX object names with spaces do not work #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use an jmx object with a space in its name
2. call check (see below)
3. get the error InstanceNotFoundException wfor a name that is cut of after the 
space.

What is the expected output? What do you see instead?

I should be able to specify JMX Object names that contain a space like 
"name=Primitive count".
I tried \ and varoius combinations of single and double quotes.

What version of the product are you using? On what operating system?
1.3 on linux

Please provide any additional information below.

Thats an excerpt from my shell while testing:

# /tmp/jmxquery-1.3/check_jmx -username "monitor" -password Neo4J  -U 
"service:jmx:rmi:///jndi/rmi://neo4j:3637/jmxrmi" -O 
'org.neo4j:instance=kernel#0,name=Primitive count' -A "NumberOfNodeIdsInUse" 
-vvv
JMX CRITICAL - org.neo4j:instance=kernel#0,name=Primitive connecting to 
org.neo4j:instance=kernel#0,name=Primitive by URL 
service:jmx:rmi:///jndi/rmi://urmel-stage01.l3muc.inside:3637/jmxrmijavax.manage
ment.InstanceNotFoundException: org.neo4j:instance=kernel#0,name=Primitive
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:662)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:638)
    at com.sun.jmx.remote.security.MBeanServerAccessController.getAttribute(MBeanServerAccessController.java:299)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1404)
    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
    at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:600)
    at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
    at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttribute(Unknown Source)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttribute(RMIConnector.java:880)
    at jmxquery.JMXQuery.execute(JMXQuery.java:230)
    at jmxquery.JMXQuery.runCommand(JMXQuery.java:69)
    at jmxquery.JMXQuery.main(JMXQuery.java:114)

Original issue reported on code.google.com by WegDa...@gmail.com on 16 Oct 2012 at 9:30

GoogleCodeExporter commented 9 years ago
I am running into the same problem!

Original comment by w...@zoosk.com on 3 Jan 2013 at 12:17

GoogleCodeExporter commented 9 years ago
I am having de same problem too.

Original comment by juanga...@gmail.com on 20 Feb 2013 at 7:41

GoogleCodeExporter commented 9 years ago
how to quote/escape in this case?

Original comment by peich...@gmail.com on 10 Apr 2013 at 3:35

GoogleCodeExporter commented 9 years ago
This can be resolved by modifying the check_jmx script to include:

"$@"

instead of just the bare:

$@

bash ignores quotes when passing arguments to java, which forces java to 
interpret them as individual arguments

Original comment by wins...@ametsitsi.com on 2 Jul 2013 at 7:33

GoogleCodeExporter commented 9 years ago
Perfect .. Thanks a lot

Original comment by rajeshwa...@dcis.net on 30 Apr 2014 at 1:00

GoogleCodeExporter commented 9 years ago
Yep,  "$@" fixes this problem.

Original comment by donn...@gmail.com on 19 Jun 2014 at 9:41