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.