1 # contrib/GenericJMX.conf
2 # -----------------------
3 #
4 # This is an example config file for the ‘GenericJMX’ plugin, a plugin written
5 # in Java to receive values via the “Java Management Extensions” (JMX). The
6 # plugin can be found in the
7 # bindings/java/org/collectd/java/
8 # directory of the source distribution.
9 #
10 # This sample config defines a couple of <MBean /> blocks which query MBeans
11 # provided by the JVM itself, i. e. which should be available for all Java
12 # processes. The following MBean blocks are defined:
13 #
14 # +-------------------+------------------------------------------------+
15 # ! Name ! Description !
16 # +-------------------+------------------------------------------------+
17 # ! classes ! Number of classes being loaded. !
18 # ! compilation ! Time spent by the JVM compiling or optimizing. !
19 # ! garbage_collector ! Number of garbage collections and time spent. !
20 # ! memory ! Generic heap/nonheap memory usage. !
21 # ! memory_pool ! Memory usage by memory pool. !
22 # +-------------------+------------------------------------------------+
23 #
24 <Plugin "java">
25 LoadPlugin "org.collectd.java.GenericJMX"
27 <Plugin "GenericJMX">
28 ################
29 # MBean blocks #
30 ################
31 # Number of classes being loaded.
32 <MBean "classes">
33 ObjectName "java.lang:type=ClassLoading"
34 #InstancePrefix ""
35 #InstanceFrom ""
37 <Value>
38 Type "gauge"
39 InstancePrefix "loaded_classes"
40 #InstanceFrom ""
41 Table false
42 Attribute "LoadedClassCount"
43 </Value>
44 </MBean>
46 # Time spent by the JVM compiling or optimizing.
47 <MBean "compilation">
48 ObjectName "java.lang:type=Compilation"
49 #InstancePrefix ""
50 #InstanceFrom ""
52 <Value>
53 Type "total_time_in_ms"
54 InstancePrefix "compilation_time"
55 #InstanceFrom ""
56 Table false
57 Attribute "TotalCompilationTime"
58 </Value>
59 </MBean>
61 # Garbage collector information
62 <MBean "garbage_collector">
63 ObjectName "java.lang:type=GarbageCollector,*"
64 InstancePrefix "gc-"
65 InstanceFrom "name"
67 <Value>
68 Type "invocations"
69 #InstancePrefix ""
70 #InstanceFrom ""
71 Table false
72 Attribute "CollectionCount"
73 </Value>
75 <Value>
76 Type "total_time_in_ms"
77 InstancePrefix "collection_time"
78 #InstanceFrom ""
79 Table false
80 Attribute "CollectionTime"
81 </Value>
83 # # Not that useful, therefore commented out.
84 # <Value>
85 # Type "threads"
86 # #InstancePrefix ""
87 # #InstanceFrom ""
88 # Table false
89 # # Demonstration how to access composite types
90 # Attribute "LastGcInfo.GcThreadCount"
91 # </Value>
92 </MBean>
94 # Generic heap/nonheap memory usage.
95 <MBean "memory">
96 ObjectName "java.lang:type=Memory"
97 #InstanceFrom ""
98 InstancePrefix "memory"
100 # Creates four values: committed, init, max, used
101 <Value>
102 Type "memory"
103 #InstancePrefix ""
104 #InstanceFrom ""
105 Table true
106 Attribute "HeapMemoryUsage"
107 InstancePrefix "heap-"
108 </Value>
110 # Creates four values: committed, init, max, used
111 <Value>
112 Type "memory"
113 #InstancePrefix ""
114 #InstanceFrom ""
115 Table true
116 Attribute "NonHeapMemoryUsage"
117 </Value>
118 </MBean>
120 # Memory usage by memory pool.
121 <MBean "memory_pool">
122 ObjectName "java.lang:type=MemoryPool,*"
123 InstancePrefix "memory_pool-"
124 InstanceFrom "name"
126 <Value>
127 Type "memory"
128 #InstancePrefix ""
129 #InstanceFrom ""
130 Table true
131 Attribute "Usage"
132 </Value>
133 </MBean>
135 ### MBeans by Catalina / Tomcat ###
136 # The global request processor (summary for each request processor)
137 <MBean "catalina/global_request_processor">
138 ObjectName "Catalina:type=GlobalRequestProcessor,*"
139 InstancePrefix "request_processor-"
140 InstanceFrom "name"
142 <Value>
143 Type "io_octets"
144 InstancePrefix "global"
145 #InstanceFrom ""
146 Table false
147 Attribute "bytesReceived"
148 Attribute "bytesSent"
149 </Value>
151 <Value>
152 Type "total_requests"
153 InstancePrefix "global"
154 #InstanceFrom ""
155 Table false
156 Attribute "requestCount"
157 </Value>
159 <Value>
160 Type "total_time_in_ms"
161 InstancePrefix "global-processing"
162 #InstanceFrom ""
163 Table false
164 Attribute "processingTime"
165 </Value>
166 </MBean>
168 # Details for each request processor
169 <MBean "catalina/detailed_request_processor">
170 ObjectName "Catalina:type=RequestProcessor,*"
171 InstancePrefix "request_processor-"
172 InstanceFrom "worker"
174 <Value>
175 Type "io_octets"
176 #InstancePrefix ""
177 InstanceFrom "name"
178 Table false
179 Attribute "bytesReceived"
180 Attribute "bytesSent"
181 </Value>
183 <Value>
184 Type "total_requests"
185 #InstancePrefix ""
186 InstanceFrom "name"
187 Table false
188 Attribute "requestCount"
189 </Value>
191 <Value>
192 Type "total_time_in_ms"
193 InstancePrefix "processing-"
194 InstanceFrom "name"
195 Table false
196 Attribute "processingTime"
197 </Value>
198 </MBean>
200 # Thread pool
201 <MBean "catalina/thread_pool">
202 ObjectName "Catalina:type=ThreadPool,*"
203 InstancePrefix "request_processor-"
204 InstanceFrom "name"
206 <Value>
207 Type "threads"
208 InstancePrefix "total"
209 #InstanceFrom ""
210 Table false
211 Attribute "currentThreadCount"
212 </Value>
214 <Value>
215 Type "threads"
216 InstancePrefix "running"
217 #InstanceFrom ""
218 Table false
219 Attribute "currentThreadsBusy"
220 </Value>
221 </MBean>
223 #####################
224 # Connection blocks #
225 #####################
226 <Connection>
227 ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:17264/jmxrmi"
228 User "monitorRole"
229 Password "queeZie1"
230 Host "localhost"
231 Collect "classes"
232 Collect "compilation"
233 Collect "garbage_collector"
234 Collect "memory"
235 Collect "memory_pool"
236 </Connection>
237 </Plugin>
238 </Plugin>