Jmx4Perl with authenticaiton for jolokia 1.6 - duplicate http requests

classic Classic list List threaded Threaded
1 message Options
erempel erempel
Reply | Threaded
Open this post in threaded view
|

Jmx4Perl with authenticaiton for jolokia 1.6 - duplicate http requests

jmx4perl 1.12
jolokia WAR-Agent 1.6.2

I'm having difficulty using the Jmx4Perl library to access teh secured jolokia WAR-Agent. The access logs show that the http request is first performed without authenticaiton, nad then immediate repeated with the authentication.

127.0.0.1 - - [21/Sep/2019:00:00:07] "GET /jolokia/read/java.lang%3Atype%3DThreading/ThreadCount HTTP/1.1" 401 1034
127.0.0.1 - uvstats [21/Sep/2019:00:00:07] "GET /jolokia/read/java.lang%3Atype%3DThreading/ThreadCount HTTP/1.1" 200 146

I am creating a JMX::Jmx4Perl object with

$jmx = JMX::Jmx4Perl->new(
    product => 'tomcat',
    url => "http://localhost:8080/jolokia",
    user => "$user",
    password => "$passwd",
    method => 'GET'
);

and then the get_attribute with

$jmx->get_attribute('THREAD_COUNT');

I can't find any complete examples of all the methods needed and in which order. Lots of examples for each method but nothing complete.

If anyone can point me to some examples or confirm that this is actually a bug I would appreciate it.