Skip Menu |

This queue is for tickets about the jmx4perl CPAN distribution.

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

People
Owner: roland [...] cpan.org
Requestors: giuseppe.furlan [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.72_1



Subject: MultiCheck bug ?
Hi Roland, Possible bug regarding MultiCheck with 0.72_1 developer release. This is my ouput : check_jmx4perl --config jmx4perl.cfg --server myserver --check jdbc_Machine_1_b OK - All 2 checks OK [1] OK DS_Status: Status : 'Running' as expected [2] OK DS_ActiveConnections: ActiveConnections : Value 0 in range | Status=Running;;!Running ActiveConnections=0;8;12 check_jmx4perl --config jmx4perl.cfg --server myserver --check jdbc_Machine_1_a CRITICAL - 2 of 2 failed (2 errors) [1] CRITICAL DS_Status: Status : 'Overloaded' matches threshold '!Running' [2] CRITICAL DS_ActiveConnections: ActiveConnections : Threshold '12' failed for value 15 | Status=Overloaded;;!Running ActiveConnections=15;8;12 check_jmx4perl --config jmx4perl.cfg --server myserver --check jdbc_Machine_1 OK - All 4 checks OK [1] OK DS_Status: Status : 'Running' as expected [2] OK DS_ActiveConnections: ActiveConnections : Value 0 in range [3] OK DS_Status: Status : 'Running' as expected [4] OK DS_ActiveConnections: ActiveConnections : Value 0 in range | Status=Running;;!Running ActiveConnections=0;8;12 Status=Running;;!Running ActiveConnections=0;8;12 This is the configuration : <MultiCheck jdbc_Machine_1> MultiCheck jdbc_Machine_1_a MultiCheck jdbc_Machine_1_b </MultiCheck> <MultiCheck jdbc_Machine_1_a> MultiCheck jdbc_Machine_1_db01 </MultiCheck> <MultiCheck jdbc_Machine_1_b> MultiCheck jdbc_Machine_1_db02 </MultiCheck> <MultiCheck jdbc_Machine_1_db01> Check DS_Status(Machine_1,DS-db01-vip) Check DS_ActiveConnections(Machine_1,DS-db01-vip,8,12) </MultiCheck> <MultiCheck jdbc_Machine_1_db02> Check DS_Status(Machine_1,DS-db02-vip) Check DS_ActiveConnections(Machine_1,DS-db02-vip,8,12) </MultiCheck> Bug description : If I run "jdbc_Machine_1_a" check then status is CRITICAL but if I run "jdbc_Machine_1" MultiCheck then "jdbc_Machine_1_a" status is OK but it should be CRITICAL. I didn't have a chance to try 0.72, so I'm not aware if It has already been fixed with this stable release. Giuseppe
Hi Guiseppe,

this is probably not fixed in 0.72 either, since thats the first time 
i heard about this kind of problem.

To further investigate this, what happens, if you put
MultiCheck jdbc_Machine_1_db01  directly in the definition
of  j dbc_Machine_1 ?

Maybe this is an issue with multiple nested MultiChecks.

...roland

From: giuseppe.furlan [...] hotmail.com
Hi Roland, same issue if I put MultiCheck jdbc_Machine_1_db01 directly in the definition. It's something related with the order because if I use this configuration (simply reserved the order) : <MultiCheck jdbc_Machine_1> MultiCheck jdbc_Machine_1_b MultiCheck jdbc_Machine_1_a </MultiCheck> then I get this : CRITICAL - 4 of 4 failed (4 errors) [1] CRITICAL DS_Status: Status : 'Overloaded' matches threshold '!Running' [2] CRITICAL DS_ActiveConnections: ActiveConnections : Threshold '12' failed for value 15 [3] CRITICAL DS_Status: Status : 'Overloaded' matches threshold '!Running' [4] CRITICAL DS_ActiveConnections: ActiveConnections : Threshold '12' failed for value 15 | Status=Overloaded;;!Running ActiveConnections=15;8;12 Status=Overloaded;;!Running ActiveConnections=15;8;12 Il Mar 05 Ott 2010 05:42:40, ROLAND ha scritto: Show quoted text
> Hi Guiseppe, > > this is probably not fixed in 0.72 either, since thats the first time > i heard about this kind of problem. > > To further investigate this, what happens, if you put > MultiCheck jdbc_Machine_1_db01 directly in the definition > of j dbc_Machine_1 ? > > Maybe this is an issue with multiple nested MultiChecks. > > ...roland
Ok, sound definitely like a bug. Thanks for the info.

I will look at it as soon as possible (but probably not this 
week anymore, since I'm on the way to a conference (OSMC).



From: giuseppe.furlan [...] hotmail.com
Hello mate, did you have any chances to look at it ? Regards Giuseppe Il Mar 05 Ott 2010 05:55:34, ROLAND ha scritto: Show quoted text
> Ok, sound definitely like a bug. Thanks for the info. > > I will look at it as soon as possible (but probably not this > week anymore, since I'm on the way to a conference (OSMC).
Hi Giuseppe,

On Mon Oct 18 04:29:17 2010, furlang75 wrote:

Show quoted text
> did you have any chances to look at it ?

I could reproduce it, and will dig further into it this week. 

Sorry for the delay, but I was busy (beside my regular work)
with launching www.jolokia.org which will hold the Java agent
part of jmx4perl in the future (and is targeted to attract more
Java developers).

bye ....
...roland
Hi Guiseppe, 

I think, I fixed it. I pushed the changes to GitHub, but you could apply the attachted patch as
well. Sorry that it took that long, especially it was only one line to change ;-|.
Please check, whether this works for you, I will make a 0.73 release then within the next two weeks.

...roland
Subject: mcheck_fix.patch
diff --git a/lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm b/lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm index 0bb66f1..acbf13a 100644 --- a/lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm +++ b/lib/JMX/Jmx4Perl/Nagios/CheckJmx4Perl.pm @@ -294,7 +294,9 @@ sub _resolve_multicheck { for my $name (@$c_names) { my ($c_name,$c_args) = $self->_parse_check_ref($name); my $args_merged = $self->_merge_multicheck_args($c_args,$args); - my $check = $config->{check}->{$c_name} || + # We need a copy of the check hash to avoid mangling it up + # if it is referenced multiple times + my $check = { %{$config->{check}->{$c_name}} } || $np->nagios_die("Unknown check '" . $c_name . "' for multi check " . $check); $check->{key} = $c_name; $check->{args} = $args_merged;
From: giuseppe.furlan [...] hotmail.com
Thanks for the patch. I have installed 0.71v so I'll update to 0.72 and then I'll apply your patch...hopefully tomorrow :) Il Mer 20 Ott 2010 11:42:00, ROLAND ha scritto: Show quoted text
> Hi Guiseppe, > > I think, I fixed it. I pushed the changes to GitHub, but you could > apply the > attachted patch as > well. Sorry that it took that long, especially it was only one line to > change > ;-|. > Please check, whether this works for you, I will make a 0.73 release > then > within the next two weeks. > > ...roland
From: giuseppe.furlan [...] hotmail.com
Hi Roland, good news, it's working ok :) Many thanks Il Mer 20 Ott 2010 12:20:28, furlang75 ha scritto: Show quoted text
> Thanks for the patch. > I have installed 0.71v so I'll update to 0.72 and then I'll apply your > patch...hopefully tomorrow :) > > Il Mer 20 Ott 2010 11:42:00, ROLAND ha scritto:
> > Hi Guiseppe, > > > > I think, I fixed it. I pushed the changes to GitHub, but you could > > apply the > > attachted patch as > > well. Sorry that it took that long, especially it was only one line to > > change > > ;-|. > > Please check, whether this works for you, I will make a 0.73 release > > then > > within the next two weeks. > > > > ...roland
> >
On Thu Oct 21 06:52:27 2010, furlang75 wrote:

Show quoted text
> good news, it's working ok :)

Good to know. And thanks for the bug report !

I will close this issue when I release 0.73.

...roland
 Fixed in 0.73