[Nagiosplug-devel] Alarm problems
Jason Abraham
Jason.Abraham at washco.utah.gov
Tue Sep 15 21:18:19 CEST 2009
I have created a plugin which uses SNMP
(http://www.washco.utah.gov/meej/check_3com_alive.txt)
and as such I have employed the recommended alarm safe-guard
----
# start counting down to timeout
alarm $plugin->opts->timeout;
your_long_check_step_that_might_time_out();
----
I use Nagios::Plugin to handle my exit state (nagios_exit). When testing
the plugin with
new_mini_epn it functions correctly and returns the correct codes. However,
if I execute
my plugin via new_mini_epn and then wait I eventually get the an alarm
error:
-----
./new_mini_epn
plugin command line: check_3com_alive.pl -H 10.0.0.10 -C pass -n 3
embedded perl plugin return code and output was: 0 & 3COM_ALIVE OK - 3 of 3
units in stack
plugin command line: CHECK_3COM_ALIVE.PL UNKNOWN - plugin timed out (timeout
15s)
ExitTrap: 3 (Redefine exit to trap plugin exit with eval BLOCK) at p1.pl
line 61, <FIN> line 1.
-----
Obviously, the alarm timer is still left running even after calling
nagios_exit. Is this a problem
with my code, Nagios::Plugin, or is it even a problem at all?
I am using nagios-plugins-1.4.13
Thanks,
Jason
More information about the Devel
mailing list