[Nagiosplug-devel] [ nagiosplug-Bugs-1373801 ] check_ping timeout on Mandrake 10.1
SourceForge.net
noreply at sourceforge.net
Thu Mar 23 03:26:03 CET 2006
Bugs item #1373801, was opened at 2005-12-05 20:01
Message generated for change (Comment added) made by tonvoon
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1373801&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alex Burger (alex_b)
>Assigned to: Ton Voon (tonvoon)
Summary: check_ping timeout on Mandrake 10.1
Initial Comment:
With Mandrake 10.1 and nagios-plugins-1.4 I had a
problem where devices that were down would return a
result of 'plugin timed out'. The attached patch fixes
the problem by adding 2 seconds to the alarm() call.
The problem was that Nagios passed a timeout value of
10 seconds to the plugin. The plugin would then call
ping with a timeout of 10 seconds (PING_HAS_TIMEOUT is
defined). This would cause the plugin to abort before
it got the result from the ping command. Adding 2
seconds to alarm will cause it to abort the plugin
after 12 seconds which will give ping enough time to
respond.
It may be better to reduce the timeout value passed to
ping. For example, instead of:
# ifdef PING_HAS_TIMEOUT
asprintf (&cmd, rawcmd, timeout_interval, max_packets,
addresses[i]);
# else
use:
# ifdef PING_HAS_TIMEOUT
if (timeout_interval > 2)
asprintf (&cmd, rawcmd, timeout_interval-2,
max_packets, addresses[i]);
else
asprintf (&cmd, rawcmd, timeout_interval, max_packets,
addresses[i]);
# else
----------------------------------------------------------------------
>Comment By: Ton Voon (tonvoon)
Date: 2006-03-23 11:24
Message:
Logged In: YES
user_id=664364
Alex,
Thanks for the report.
It seems to me that there are two things going on here:
1. a timeout could be placed on each ping command
2. an overall timeout of the plugin, timeout_interval
I'm not keen on your suggestion of just bumping timeout_interval by 2, so I
think what we need to do is calculate the timeout for each ping command.
This is complicated by the fact that you can specify a number of addresses to
ping.
I'm guessing each individual ping command should have a timeout of max(1,
(timeout_interval-1))/number of addresses.
There's also a bit of code which alters the timeout_interval based on the
number of packets requested and the critical rta threshold:
max_seconds = crta / 1000.0 * max_packets + max_packets;
if (max_seconds > timeout_interval)
timeout_interval = (int)max_seconds;
I'm really not keen on this because I think the timeout_interval should be
fixed to whatever has been specified on the command line.
I'm not sure what the best way to proceed is. Any other opinions?
Ton
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1373801&group_id=29880
More information about the Devel
mailing list