JDK-8023093 : Add ManagementAgent.status diagnostic command
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 8
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-08-15
  • Updated: 2017-05-17
  • Resolved: 2015-04-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b64Fixed
Related Reports
Cloners :  
Sub Tasks
JDK-8179939 :  
Description
Would like a diagnostic command for local use, to determine if the remote jmx agent has been started,
and if so, on what port.

Something like
ManagementAgent.status

Output should be something parsable to true/false, preferable containing a port if applicable.


Comments
I think we can keep to \n, it's actuallt better than relying on the line.separator being the same in the two different processes, although they are running on the same machine, they could have been changed by the user.
21-09-2015

Is this causing problems? If yes, please, file an issue for this and it can be fixed pretty quickly.
16-09-2015

Just a comment on the line separators, it seems you are using \n on all platforms, instead of using the line.separator system property ?
16-09-2015

Also, can we get the URL that will be transmitted as host in the stub that get sent to the remote client for #3? Would be great for troubleshooting, for example in the standard, badly configured linux case, when it resolves to localhost.
08-12-2014

Hm. Protocol will be JMXRMI even in the horrible abomination of the serialized stub in the local case, so maybe something else.
08-12-2014

Looks reasonable to me. Can you ever have both the local and the remote agent at the same time?
08-12-2014

We will, in the future, probably have different remoting protocols. Maybe we rather want the protocol after the colon? agent: jmxrmi Also, we may want one entry for each agent started, just to be future proof.
08-12-2014

Remote implies local, right?
08-12-2014

Would this kind of output make sense? 1. Management agent disabled ``` jbachorik@nibbler:~/src/java/jdk9-hs/build/linux-x86_64-normal-server-release/images/j2sdk-image/bin$ ./jcmd 25365 ManagementAgent.status 25365: agent: none ``` 2. Local management agent only ``` jbachorik@nibbler:~/src/java/jdk9-hs/build/linux-x86_64-normal-server-release/images/j2sdk-image/bin$ ./jcmd 25365 ManagementAgent.status 25365: agent: local url=service:jmx:rmi://127.0.0.1/stub/rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LnJlbW90ZS5ybWkuUk1JU2VydmVySW1wbF9TdHViAAAAAAAAAAICAAB4cgAaamF2YS5ybWkuc2VydmVyLlJlbW90ZVN0dWLp/tzJi+FlGgIAAHhyABxqYXZhLnJtaS5zZXJ2ZXIuUmVtb3RlT2JqZWN002G0kQxhMx4DAAB4cHc0AAtVbmljYXN0UmVmMgAACTEyNy4wLjEuMQAAsNyPRg5AkX93W8bYrAAAAAFJyCNRJ4ABAHg=) ``` 3. Remote management agent ``` jbachorik@nibbler:~/src/java/jdk9-hs/build/linux-x86_64-normal-server-release/images/j2sdk-image/bin$ ./jcmd 25365 ManagementAgent.status 25365: agent: remote com.sun.management.jmxremote.authenticate=false com.sun.management.jmxremote.port=3336 com.sun.management.jmxremote.rmi.port=9999 ```
19-11-2014