root / plugins / jmx / readme.txt @ 17f78427
Historique | Voir | Annoter | Télécharger (3 ko)
| 1 |
-------- JMX plugin for Munin --------- |
|---|---|
| 2 |
|
| 3 |
Java JMX Munin plugin enables you to monitor JMX attributes in Munin. |
| 4 |
As soon as JMX embedded in Java 5, any Java process may expose parameters to be monitored using JMX interface, |
| 5 |
look http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html and http://java.sun.com/jmx for details |
| 6 |
In Java version < 5 it is still possible to expose JMX interface using third party libraries |
| 7 |
|
| 8 |
To see what can be monitored by JMX, run <JDK>/bin/jconsole.exe and connect to |
| 9 |
the host/port you setup in your Java process. |
| 10 |
|
| 11 |
Some examples are: |
| 12 |
* standard Java JMX implementation exposes memory, threads, OS, garbage collector parameters |
| 13 |
* Tomcat exposes multiple parameters - requests, processing time, threads, etc.. |
| 14 |
* spring framework allows to expose Java beans parameters to JMX |
| 15 |
* your application may expose any attributes for JMX by declaration or explicitly. |
| 16 |
* can monitor localhost or remote processes |
| 17 |
|
| 18 |
-------- Installation --------- |
| 19 |
|
| 20 |
Pre-requsisites are: |
| 21 |
- installed munin-node |
| 22 |
- Java version 5 JRE |
| 23 |
|
| 24 |
1) Files from "plugin" folder must be copied to /usr/share/munin/plugins (or another - where your munin plugins located) |
| 25 |
2) Make sure that jmx_ executable : chmod a+x /usr/share/munin/plugins/jmx_ |
| 26 |
3) Copy configuration files that you want to use, from "examples" folder, into /usr/share/munin/plugins folder |
| 27 |
4) create links from the /etc/munin/plugins folder to the /usr/share/munin/plugins/jmx_ |
| 28 |
The name of the link must follow wildcard pattern: |
| 29 |
jmx_<configname>, |
| 30 |
where configname is the name of the configuration (config filename without extension), for example: |
| 31 |
ln -s /usr/share/munin/plugins/jmx_ /etc/munin/plugins/jmx_process_memory |
| 32 |
5) optionally specify the environment variable for JMX URL. The default URL corresponds to localhost:1616. |
| 33 |
If you have different port listening by JMX or different hostname to monitor, specify jmxurl parameter |
| 34 |
in /etc/munin/plugin-conf.d/munin-node: |
| 35 |
|
| 36 |
[jmx_*] |
| 37 |
env.jmxurl service:jmx:rmi:///jndi/rmi://localhost:1616/jmxrmi |
| 38 |
|
| 39 |
-------- Check Installation --------- |
| 40 |
|
| 41 |
To check that all installed properly, try invoke plugins from command line, using links like: |
| 42 |
|
| 43 |
root@re:/etc/munin/plugins# ./jmx_java_process_memory config |
| 44 |
graph_category appserver |
| 45 |
... |
| 46 |
root@re:/etc/munin/plugins# ./jmx_java_process_memory |
| 47 |
java_memory_nonheap_committed.value 35291136 |
| 48 |
... |
| 49 |
|
| 50 |
If you have configured environment for jmxurl, do not forget to export it before! |
| 51 |
|
| 52 |
-------- Configuration Files --------- |
| 53 |
|
| 54 |
Folder "examples" contains configuration files for Java and Tomcat monitoring examples. |
| 55 |
The format of configuration file is a superset of Munin plugin "config" command output |
| 56 |
(http://munin.projects.linpro.no/wiki/protocol-config) |
| 57 |
It has the following additions: |
| 58 |
|
| 59 |
<fieldname>.jmxObjectName JMX object name, e.g. java.lang:type=Memory |
| 60 |
<fieldname>.jmxAttributeName JMX attribute name, e.g. NonHeapMemoryUsage |
| 61 |
<fieldname>.jmxAttributeKey If attribute is a composed data (structure), the name of the field in structure, e.g. max |
| 62 |
|
| 63 |
% separates comments in file |
| 64 |
|
| 65 |
|
| 66 |
|
