Skip Menu |

This queue is for tickets about the jmx4perl CPAN distribution.

Report information
The Basics
Id: 62915
Status: resolved
Priority: 0/
Queue: jmx4perl

People
Owner: roland [...] cpan.org
Requestors: roland [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.73
Fixed in: 0.74



Subject: Single slash as argument for an operation doesn't work
  ’d also like to report a problem with JMX operations, when the parameter is “/” …

As reported by  sysprv on the labs.consol.de blog:

For ex:

check_jmx4perl -u http://host:8778/jolokia/ -m linuxagent:type=Volumes -c 90 -w 70 -o getUsage /

UNKNOWN – Error: 400 java.lang.IllegalArgumentException : No operation getUsage/ found on MBean linuxagent:type=Volumesjava.lang.IllegalArgumentException: No operation getUsage/ found on MBean linuxagent:type=Volumes at org.jolokia.handler.ExecHandler.extractMBeanParameterInfos(ExecHandler.java:149) at org.jolokia.handler.ExecHandler.extractOperationTypes(ExecHandler.java:108)

The point is to get the free space percentage of the / fs.

If the last parameter is /var or whatever, then everything works as expected.

Sound like an issue with jmx4perl’s GET requests.

Jolokia/jmx4perl has two operational modes: Either via GET or POST requests. For GET requests an URL encoding is used with ‘/’ being the separators of the various requests parameters including some escaping when / is part of a request value. Obviously, this fails here. I opened a ticket for this on rt.cpan.org and will fix this.

In the meantime, you can switch to the POST mode (which is more powerful anyway). Normally, the operational mode is selected automatically and I added a ‘–method’ for jmx4perl in the latest 0.73, but unfortunately I forgot to add this for check_jmx4perl ;-(

So, you have to fix this manually by patching JMX/Jmx4Perl/Agent.pm at line 239 (for jmx4perl 0.73):

 

sub _use_GET_request {
   # Always use POST
   return 0;
 
   my $self = shift;
   my $reqs = shift;
    ....
}

Coming with 0.74 there will a configuration option for check_jmx4perl for manually selecting the HTTP method.

This issue is fixed in 0.74, which get's released this evening.

On Thu Nov 11 02:40:14 2010, ROLAND wrote:
Show quoted text
> Sound like an issue with jmx4perl’s GET requests.
>
> Jolokia/jmx4perl has two operational modes: Either via GET or POST
> requests.
> For GET requests an URL encoding is used with ‘/’ being the separators
> of the
> various requests parameters including some escaping when / is part of
> a request
> value. Obviously, this fails here. I opened a ticket for this on
> rt.cpan.org
> and will fix this.
>
> In the meantime, you can switch to the POST mode (which is more
> powerful
> anyway). Normally, the operational mode is selected automatically and
> I added a
> ‘–method’ for jmx4perl in the latest 0.73, but unfortunately I forgot
> to add
> this for check_jmx4perl ;-(
>
> So, you have to fix this manually by patching JMX/Jmx4Perl/Agent.pm at
> line 239
> (for jmx4perl 0.73):
>
> sub _use_GET_request { # Always use POST return 0; 
> my $self =
> shift; my $reqs = shift; ....}
>
> Coming with 0.74 there will a configuration option for check_jmx4perl
> for
> manually selecting the HTTP method.