[Nagiosplug-devel] check_ping timeout calculation

Thomas Guyot-Sionnest dermoth at aei.ca
Sat Jan 6 06:10:39 CET 2007


On 04/01/07 05:46 PM, Thomas Guyot-Sionnest wrote:
> While testing the previous patch for check_ping I noticed the the
> max_seconds calculation was way off what it could calculate as max_seconds.
> 
> The part shown in the patch below is to increase the timeout_interval
> used in alarm() if the other ping parameters does not make sense with
> the supplied or default timeout value set.
> 
> In the patch below I calculate max_seconds my simply multiplying the
> critical time by the number of packets. If max_seconds is not an integer
> I round it up to the higher value. In the previous patch I comited I
> also add one second to the alarm so that it does not trigger it when
> ping take the expected time for a non-responding host (when max_seconds
> == timeout_interval).
> 
> Alternatively I could undo the last patch and add one second in the part
> below if max_seconds == (int)max_seconds, but I fear that it trigger the
> alarm in some cases, like if max_seconds == 1.9999.. which is very close
> to the 2 seconds that would be set in the alarm.
> 
> Any comments before I submit this patch?
> 

I committed the said patch, and have one more thing. The timeout help
text in inaccurate, and the timeout parameter itself is useless. We
should either:

1. Remove -t, leaving the code as a no-op to avoid breaking anything
or
2. Fix the text. I didn't do it because I'm not sure if it'll break
anything localization-related.

Ton, do you think it make sense to just remove -t, leaving a comment like:

"This check script has no timeout option. The actual timeout can be
calculated as 'critical_threshold * packets'."

That would be done without breaking backward compatibility, leaving -t
as a no-op.

Thomas




More information about the Devel mailing list