JSMX is a simple demo of monitor & management solution with JMX, it includes:
- declaring mbean, which used pojo-mbean;
- real-time web console, which used jolokia and highcharts;
- integrating with ganglia , which used jmxetric;
- runtime dynamic trace invocation, which used asm.
- git clone git@github.com:zhongl/jsmx.git;
- import it to eclipse;
- make sure ganglia-3.1.x has been set up(how to set up );
- make sure “hostname” and “port” in jsmx/demo/etc/jmxetric.xml pointed to gmond;
- run jsmx/demo/realtime-monitor-management-demo.launch;
- use your web browser open jsmx/core/src/main/resourcse/dashboard.html, then you can see the real-time web console;
- run jsmx/demo/ganglia-demo.launch
- use your web browser open ganglia web(eg: http://localhost/ganglia ), then you can see mbean state trends in ganglia.
- run jsmx/demo/ztrace.launch
- run jconsole, and connect to Demo process;
- go to MBean→jsmx;
- click Demo→Attributes, you can see nothing show at console but loaded message;
- invoke ProbeInstrumentor→Operations→addProbeClass: com.github.zhongl.jsmx.demo.Demo$ManagableServer;
- invoke ProbeInstrumentor→Operations→probe;
- click Demo→Attributes again, you can see trace log at console now;
- invoke ProbeInstrumentor→Operations→reset;
- click Demo→Attributes again, you can see no more trace log at console.
Enjoy it!