Skip Menu |

This queue is for tickets about the jmx4perl CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: work [...] paul.dubuc.org
Cc:
AdminCc:

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



Subject: check_jmx4perl --timeout (-t) option doesn't work
The --timeout option for check_jmx4perl can't be use to change the default (180 sec.). The Nagios::Plugin module is responsible for setting up the timeout handler and providing a default value (15), but the plugin is still responsible for calling the alarm() function with the timeout value. See documentation here: http://search.cpan.org/~tonvoon/Nagios-Plugin-0.35/lib/Nagios/Plugin.pm CheckJmx4Perl::create_nagios_plugin() should call alarm($np->opts->timeout); after calling $np->getopts(). It should also add the argument timeout => 180 to Nagios::Plugin->new() to override the Nagios::Plugin default value (15). I suggest a much shorter default timeout than 180 seconds, but that is what you have documented now. As is works now the 180 second timeout seems to be enforced by the web server, not the plugin. I get a 500 error from the application web server when the timeout occurs, not an ALM signal in the plugin.
In fact, you hit a dark (because forgotten) spot in check_jmx4perl. The timeout was meant
to be the HTTP Timeout value when contacting the agent. This is by default 180s in LWP::UserAgent but
can be tuned. However the link to the command line option --timeout was never implemented 
(so the default value was always used).

I even wasn't aware the Nagios::Plugin provides a timeout mechanism on its own, so this is not 
setup properly, too. 

I will fix this for 0.91 (by either providing a single timeout value which is used locally or by giving
the possibility to provid two timeout values, don't know yet)

Thanks a lot for spotting this.

--timeout can now be specified and is used for the timeout of the HTTP requests. check_jmx4perl
wont use an alarm() since this doesnt play nicely with the timeout of the HTTP request in LWP::UserAgent.
Since the HTTP call is the only call which can timeout this should be save.

The change is pushed to github and will be available in 0.91.

 Fixed in 0.91