Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to JMX agent using python [closed]

I am working on custom monitoring system to my server.

the application is developed using python and Django.

The server is running java web applications and I need to monitor the JVM under which the application server is running, so I start the applications with enable the JMX.

Now I need to connect my python application to the JVM JMX agent.

Is there any way to get that?

I have read about the HtmlAdapterServer, that enable managing JMX MBeans from specific url but I do not know how can I use it?

Thanks in advance and best regards

like image 272
Fanooos Avatar asked Aug 16 '10 06:08

Fanooos


People also ask

How do I connect my JMX console?

To connect JConsole to server process, in the Remote Process section, specify the URL service:jmx:rmi:///jndi/rmi://localhost:2047/fmq and credentials pertaining to the server. Default user name and password are admin and passwd respectively.

How do I enable JMX agent?

A common way to enable local JMX access on these JVMs is to include the -Dcom. sun. management. jmxremote option on the command line when you start the JVM.

How do I check my JMX connection?

The JMX connection will appear in the application tree, with a special JMX connection icon. Right click on the JMX connection, and select Open. The JVM software exposed via the JMX connection can now be monitored and managed via Java VisualVM.


2 Answers

How about using Jython ? http://www.jython.org/

like image 59
monojohnny Avatar answered Sep 23 '22 06:09

monojohnny


There is a reference implementation of a WebServices based JMXServer you can deploy on your server. Based on the docs, it is possible to use VB Scripting to invoke JMX operations, so I would assume you could use Python too.

Update:

Jolokia provides an HTTP/REST API to access JMX MBeanServers. This should be easily invoked by a python client.

like image 27
Nicholas Avatar answered Sep 25 '22 06:09

Nicholas