Skip Menu |

This queue is for tickets about the jmx4perl CPAN distribution.

Report information
The Basics
Id: 69167
Status: open
Priority: 0/
Queue: jmx4perl

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

Bug Information
Severity: Wishlist
Broken in: 0.92
Fixed in: (no value)



Subject: check_jmx4perl does not fully support aliases
I wrote a simple alias to check cpu usage, e.g.: ===============================8<====================================== package JMX::Jmx4Perl::Product::Custom; .... sub name { return "custom"; } .... sub init_aliases { my $self = shift; return { attributes => { OS_CPU_TIME => sub { my $self = shift; my $jmx = $self->{jmx4perl}; my $request = new JMX::Jmx4Perl::Request (READ,"java.lang:type=OperatingSystem","ProcessCpuTime"); my $begin = $jmx->request($request); sleep 10; my $end = $jmx->request($request); return new JMX::Jmx4Perl::Response( value => sprintf("%.2f",($end->value - $begin->value) / ($end->timestamp - $begin->timestamp) / 10000000), status => 200, timestamp => time ) }, }, operations => { } } } ===============================>8====================================== jmx4perl works like expected, but check_jmx4perl returns an error: UNKNOWN - Error: encountered CODE(0x9aed2dc), but JSON can only represent references to arrays or hashes at /usr/local/nagios/perl/lib/JSON.pm line 143. seems it tries serialize request to JSON without checkin alias information like jmx4perl does
Hi,

sorry, this ticket slipped through somehow. I will have a look at this issue ASAP.