http://jira.hyperic.com/browse/HHQ-4287
The tc Runtime server jmx.password is displayed as plain text in agent.log.
When the tc Runtime server is stopped, an Error is reported in the agent.log for contacting resource: Can't connect to MBeanServer.
010-09-08 16:59:07,706 DEBUG [Thread-0] [SSLConnectionListener] Handling SSL connection from /10.150.29.224
2010-09-08 16:59:07,985 DEBUG [Thread-0] [CommandListener] Dispatching request for 'rtm:getMeasurements'
2010-09-08 16:59:07,992 DEBUG [Thread-0] [MeasurementCommandsService] Getting real time measurement: sigar:Type=ProcState,Arg=State.Name.sw%3Djava%2CArgs..eq%3D-Dcatalina.base%3D/opt/springsource/springsource-tc-server-standard/myserver:State:jmx.url=service%3Ajmx%3Armi%3A///jndi/rmi%3A//127.0.0.1%3A6969/jmxrmi,jmx.username=admin,jmx.password=springsource
2010-09-08 16:59:07,992 DEBUG [Thread-0] [MeasurementCommandsService] Result was: 0
2010-09-08 16:59:07,997 DEBUG [Thread-0] [MeasurementCommandsService] Error getting real time measurement 'java.lang:type=Threading:CurrentThreadCpuTime:jmx.url=service%3Ajmx%3Armi%3A///jndi/rmi%3A//127.0.0.1%3A6969/jmxrmi,jmx.username=admin,jmx.password=*****': Error contacting resource: Can't connect to MBeanServer [{jmx.password=springsource, jmx.username=admin, jmx.url=service:jmx:rmi:///jndi/rmi://127.0.0.1:6969/jmxrmi}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused]
org.hyperic.hq.product.MetricUnreachableException: Can't connect to MBeanServer [{jmx.password=springsource, jmx.username=admin, jmx.url=service:jmx:rmi:///jndi/rmi://127.0.0.1:6969/jmxrmi}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused]
at org.hyperic.hq.product.jmx.MxUtil.unreachable(MxUtil.java:154)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:318)
at org.hyperic.hq.product.jmx.MxMeasurementPlugin.getValue(MxMeasurementPlugin.java:58)
at com.springsource.hq.plugin.tcserver.plugin.TomcatMeasurementPlugin.getValue(TomcatMeasurementPlugin.java:216)
at org.hyperic.hq.product.MeasurementPluginManager.getPluginValue(MeasurementPluginManager.java:176)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:274)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:135)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:127)
at org.hyperic.hq.measurement.agent.server.MeasurementCommandsService.getMeasurements(MeasurementCommandsService.java:201)
at org.hyperic.hq.measurement.agent.server.MeasurementCommandsServer.dispatchCommand(MeasurementCommandsServer.java:168)
at org.hyperic.hq.agent.server.CommandDispatcher.processRequest(CommandDispatcher.java:112)
at org.hyperic.hq.agent.server.CommandListener.listenLoop(CommandListener.java:191)
at org.hyperic.hq.agent.server.AgentDaemon.start(AgentDaemon.java:844)
at org.hyperic.hq.agent.server.AgentDaemon$RunnableAgent.run(AgentDaemon.java:926)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused]
at javax.management.remote.rmi.RMIConnector.connect(Unknown Source)
at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
at org.hyperic.hq.product.jmx.MxUtil.getMBeanConnector(MxUtil.java:457)
at org.hyperic.hq.product.jmx.MxUtil.connect(MxUtil.java:487)
at org.hyperic.hq.product.jmx.MxUtil.getMBeanServer(MxUtil.java:544)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:574)
at org.hyperic.hq.product.jmx.MxUtil.getValue(MxUtil.java:308)
... 13 more
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(Unknown Source)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(Unknown Source)
at javax.management.remote.rmi.RMIConnector.findRMIServer(Unknown Source)
... 20 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
... 25 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
... 30 more
There are several instances where the jmx.password is displayed in plain text. Since it is a password and masked in the Configuration Properties, it should also be masked in the agent.log.
Expected Result:
All passwords are masked and hidden.
Actual Result:
The tc Runtime server jmx.password is not masked and displayed in plain text.
Steps to Reproduce:
1. Install and start hq-agent on platform running tc Server
2. Log into Hyperic
3. Add to inventory from auto-discover
4. Go to Inventory tab and set Configuration Properties for tc Runtime
5. Go to Control tab
6. Stop the tc Server from the command line
7. Tail the agent.log
8. Note the jmx.password is displayed in plain text
Work Around:
None
Additional Information:
When the tc Runtime server is running, the jmx.password is masked:
2010-09-08 17:24:00,023 DEBUG [ScheduleThread] [ScheduleThread] [2:11514:UTILIZATION] Metric='SpringSource tc Runtime 6.0:java.lang:type=OperatingSystem:FreeSwapSpaceSize:jmx.url=service%3Ajmx%3Armi%3A///jndi/rmi%3A//127.0.0.1%3A6969/jmxrmi,jmx.username=admin,jmx.password=**' -> 2,113,921,024 timestamp=1283981040022
The tc Server Standard 2.5.0.CI-156 build was used with the springsource-tc-server-hq-plugin-server/agent-2.5.0-Ci-64 build.
Anonymous