问题
I'm a python programmer, and want to monitor a Java application, by communicating with JMX.
I've been searching the web and I haven't found a proved solution.
I've looked at jmx4python and JPype but I haven't maid up my mind about them.
Py4J doesn't look useful.
Does anyone have a suggestion of a Framework or a way to do this?
btw - The application is already running and I don't want to invoke it
回答1:
Jolikia is an http-jmx that can help you : http://www.jolokia.org
回答2:
You could use jython to interface with Java's JMX libraries.
回答3:
Your best bet would be to utilize Jython (http://jython.org) for this task. It can call all of the fancy JMX stuff without you having to rewrite the binary protocol stuff that it uses, in the comfort of Python syntax.
Note, however, that Jython isn't 100% compatible with CPython (usually library related stuff), though in practice it's pretty darn good. The current version of Jython seems to support the language defined by CPython 2.7.
来源:https://stackoverflow.com/questions/19900067/monitoring-java-application-with-python