Kunal Suri
Kunal Suri

Reputation: 18

programmatically get server load information from Apache ServiceMix using JMX

Is it possible to get the server load information of a webserver deployed on a ServiceMix / Fuse ESB.

I dont want to use Jconsole but get the information by running a java file and writing the values into text file.

Could someone point me to some code that I can run on my machine?

Cheers, Kunal

Upvotes: 0

Views: 405

Answers (2)

Claus Ibsen
Claus Ibsen

Reputation: 55525

You can also intall jolokia i ServiceMix which exposes a REST interface over JMX. This makes it much easier for non Java developers and programming languages to access the metrics. It's just a HTTP call to get the data.

http://www.jolokia.org/

We use this library for the http://hawt.io management console so we can get the data easily from a moderne HTML5 web console.

Upvotes: 1

Petter Nordlander
Petter Nordlander

Reputation: 22279

I won't write the code you ask for, but..

Everything in JConsole is accessed through JMX. And everything in JMX is accessible via code as well (basic tutorial here).

So just locate the value/values you are intressted in using JConsole, then just extract them using the JMX api in code.

Upvotes: 1

Related Questions