0

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

рüффп
  • 5,172
  • 34
  • 67
  • 113
Kunal Suri
  • 18
  • 2

2 Answers2

1

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.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84
1

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.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Thanks for the info Claus. I will surely go through this link. Its just that as per the requirement of my project I do need to create a basic java class and get the metrics from there. – Kunal Suri May 21 '13 at 10:06