Hello team!
I am trying to use the Jolokia module of Metricbeat to collect jmx metrics and get this error:
failed to unmarshal jolokia JSON response '{"request":{"type":"version"},"value":{"agent":"1.6.0","protocol":"7.2","config":{"listenForHttpService":"true","authIgnoreCerts":"false","agentId":"","debug":"false","agentType":"servlet","policyLocation":"classpath:\/jolokia-access.xml","agentContext":"\/jolokia","serializeException":"false","mimeType":"text\/plain","dispatcherClasses":"org.jolokia.http.Jsr160ProxyNotEnabledByDefaultAnymoreDispatcher","authMode":"basic","streaming":"true","canonicalNaming":"true","historyMaxEntries":"10","allowErrorDetails":"true","allowDnsReverseLookup":"true","realm":"jolokia","includeStackTrace":"true","useRestrictorService":"false","debugMaxEntries":"100"},"info":{"product":"tomcat","vendor":"Apache","version":"8.5.6"}},"timestamp":1550758168,"status":200}': json: cannot unmarshal object into Go value of type []jmx.Entry
I use this metricbeat conf:
###################### Metricbeat Configuration Example #######################@
#========================== Modules jolokia configuration ============================
metricbeat.modules:
- module: jolokia
metricsets: ["jmx"]
enabled: true
period: 10s
namespace: "metrics"
hosts: ["localhost"]
http_method: "POST"
path: "/plugins/servlet/jolokia/"
#username: ""
#password: ""
jmx.mappings:
- mbean: 'Catalina:type=Manager,host=localhost,context=/'
attributes:
- attr: activeSessions
field: activeSessions
- mbean: 'Catalina:type=ThreadPool,name="http-nio8090"'
attributes:
- attr: connectionCount
field: connectionCount
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage.max
field: heapMemoryUsageMax
- mbean: 'java.lang:type=Memory'
attributes:
- attr: HeapMemoryUsage.used
field: heapMemoryUsed
setup.template.settings:
index:
number_of_shards: 1,
number_of_replicas: 0,
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
hosts: ["elastic:9200"]
#username: "elastic"
#password: "vaudoise"
We are using metricbeat-6.2.4 and also a 6.2.4 elasticsearch.
Thx for your help !!!