[Nagiosplug-devel] [ nagiosplug-Bugs-1373801 ] check_ping timeout on Mandrake 10.1

SourceForge.net noreply at sourceforge.net
Mon Dec 5 12:02:02 CET 2005


Bugs item #1373801, was opened at 2005-12-05 15:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Nobody/Anonymous (nobody)
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


----------------------------------------------------------------------

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