From: Wilfried Goesgens Date: Mon, 9 Oct 2017 22:32:47 +0000 (+0200) Subject: add jolokia documentation & configuration X-Git-Tag: collectd-5.12.0~4^2^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f638f7cf952cdf3069fd2e0ee25c2ddb4891e9d2;p=thirdparty%2Fcollectd.git add jolokia documentation & configuration --- diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 1d0320fd6..b7f85e339 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -114,6 +114,7 @@ @LOAD_PLUGIN_CSV@LoadPlugin csv #@BUILD_PLUGIN_CURL_TRUE@LoadPlugin curl #@BUILD_PLUGIN_CURL_JSON_TRUE@LoadPlugin curl_json +#@BUILD_PLUGIN_CURL_JSON_TRUE@LoadPlugin curl_jolokia #@BUILD_PLUGIN_CURL_XML_TRUE@LoadPlugin curl_xml #@BUILD_PLUGIN_DBI_TRUE@LoadPlugin dbi #@BUILD_PLUGIN_DCPMM_TRUE@LoadPlugin dcpmm @@ -523,6 +524,87 @@ # # +# Adjust the location of the jolokia plugin according to your setup +# specify a username/password which has access to the values you want to aggregate +# use jolokia_2_collectd.py to generate a more detailed config. +# +# +# Host "_APPPERF_JMX" +# User "webloginname" +# Password "passvoid" +# Post "[{\"config\":{},\"type\":\"read\",\"mbean\":\"java.lang:name=PS Scavenge,type=GarbageCollector\",\"attribute\":[\"CollectionTime\",\"CollectionCount\"]},{\"config\":{},\"type\":\"read\",\"mbean\":\"java.lang:type=Threading\",\"attribute\":[\"CurrentThreadUserTime\",\"CurrentThreadCpuTime\"]},{\"config\":{},\"type\":\"read\",\"mbean\":\"java.lang:type=Runtime\",\"attribute\":[\"Uptime\"]},{\"config\":{},\"type\":\"read\",\"mbean\":\"java.lang:type=ClassLoading\",\"attribute\":[\"LoadedClassCount\",\"TotalLoadedClassCount\"]}]" +# +# +# MBean "java.lang:name=PS Scavenge,type=GarbageCollector" +# BeanNameSpace "java_lang" +# +# Attribute "CollectionTime" +# type "gauge" +# +# +# Attribute "CollectionCount" +# type "gauge" +# +# +# +# +# MBean "java.lang:type=Runtime" +# BeanNameSpace "java_lang" +# +# Attribute "Uptime" +# type "gauge" +# +# +# +# +# MBean "java.lang:type=ClassLoading" +# BeanNameSpace "java_lang" +# +# Attribute "LoadedClassCount" +# type "gauge" +# +# +# Attribute "TotalLoadedClassCount" +# type "gauge" +# +# +# +# +# MBean "java.lang:type=OperatingSystem" +# BeanNameSpace "java_lang" +# +# Attribute "SystemLoadAverage" +# type "gauge" +# +# +# Attribute "OpenFileDescriptorCount" +# type "gauge" +# +# +# Attribute "ProcessCpuTime" +# type "gauge" +# +# +# Attribute "FreePhysicalMemorySize" +# type "gauge" +# +# +# Attribute "FreeSwapSpaceSize" +# type "gauge" +# +# +# Attribute "ProcessCpuLoad" +# type "gauge" +# +# +# Attribute "SystemCpuLoad" +# type "gauge" +# +# +# +# +# + # # # AddressFamily "any" diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 18fda8ed4..b7e31d956 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -2248,6 +2248,124 @@ option is mandatory. Type-instance to use. Defaults to the current map key or current string array element value. +=back +=head2 Plugin C + +The B collects values from MBeanServevr - servlet engines equipped +with the jolokia (L) MBean. It sends a pre-configured +JSON-Postbody to the servlet via HTTP commanding the jolokia Bean to reply with +a singe JSON equipped with all JMX counters requested. +By reducing TCP roundtrips in comparison to conventional JMX clients that +query one value via tcp at a time, it can return hundrets of values in one roundtrip. +Moreof - no java binding is required in collectd to do so. + +It uses B (L) to parse the +Jolokia JSON reply retrieved via B (L) + + + + Host "_APPPERF_JMX" + User "webloginname" + Password "passvoid" + Post + + + MBean "java.lang:name=PS Scavenge,type=GarbageCollector" + BeanNameSpace "java_lang" + + Attribute "CollectionTime" + type "gauge" + + + Attribute "CollectionCount" + type "gauge" + + + + +The plugin is intended to be written in a simple manner. Thus it doesn't +try to solve the task of generating the jolokia post data, or automatically +map the values, but rather leans on a verbose config containing the prepared +flat JSON post data and a config section per gauge transformed (as one sample shown +above). However, Jolokia can output all available gauges, and we have a python +script to filter them, and generate a configuration for you: + + jolokia_2_collectcfg.py + +it can gather all interesting gauges, write a simple one value per line config +for itself and subsequent calls. +You can remove lines from this file manually, or create filter lists. +You then use the script to generate a collectd config. +The script can then inspect data files from some testruns, and remove +all gauges, that don't contain any movement. + +The base config looks like this: + +The following options are valid within B blocks: + +=over 4 + +=item B I + +Use I as the host name when submitting values. Defaults to the global +host name setting. + +=item B I + +Use I as the plugin name when submitting values. +Defaults to C. + +=item B I + +Sets the plugin instance to I. + +=item B I + +Sets the interval (in seconds) in which the values will be collected from this +URL. By default the global B setting will be used. + +=item B I + +=item B I + +=item B B|B + +=item B B|B + +=item B B|B + +=item B I + +=item B
I
+ +=item B I + +=item B I + +These options behave exactly equivalent to the appropriate options of the +I plugin. Please see there for a detailed description. + +=item BBeanNameE> + +One B block configures the translation of the gauges of one bean +to their respective collectd names. + +=back + +The following options are valid within B blocks: + +=over 4 + +=item B I + +Sets the type used to dispatch the values to the daemon. Detailed information +about types and their configuration can be found in L. This +option is mandatory. + +=item B I + +Type-instance to use. Defaults to the current map key or current string array element value. + =back =head2 Plugin C