You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both check_ntp_time and check_ntp return just first measured offset, instead of wanted average of four measurements. There is used bad index j (equeal to 0) instead of correct index i in avg_offset loop:
So avg_offset counts num_responses times the same first measured offset, then it is divided by num_responses, and first measured offset is back in avg_offset, instead of wanted average.
Also, I think that counting just an arithmetic average is not very good thing. For example, when there are measured values 0.001, 1.000, 0.001 and 0.001, the result will be 0.25075, whereas I think that there should be some logic, which skips obviously bad value 1.000, and result should be 0.001.
The text was updated successfully, but these errors were encountered:
waja
added a commit
to waja/monitoring-plugins
that referenced
this issue
Oct 1, 2013
1. A minor change which makes the AVG_NUM configurable by compiler define.
2. The more important change: A fix for a bug which caused the check_ntp_time
and check_ntp_time check to always take the first response from ntp and not
the avarage since "j" is not increased anywhere. "i" should be used there
instead.
(Closes: monitoring-plugins#956)
(Closes: monitoring-plugins#1089)
(Closes: monitoring-plugins#1166)
waja
added a commit
to waja/monitoring-plugins
that referenced
this issue
Jan 24, 2014
The more important change: A fix for a bug which caused the check_ntp_time
and check_ntp_time check to always take the first response from ntp and not
the avarage since "j" is not increased anywhere. "i" should be used there
instead.
Partly Closesmonitoring-plugins#956 and Closesmonitoring-plugins#1166Closes: monitoring-plugins#1089
Submitted by None on 2012-08-01 02:54:31
Both check_ntp_time and check_ntp return just first measured offset, instead of wanted average of four measurements. There is used bad index j (equeal to 0) instead of correct index i in avg_offset loop:
So avg_offset counts num_responses times the same first measured offset, then it is divided by num_responses, and first measured offset is back in avg_offset, instead of wanted average.
Also, I think that counting just an arithmetic average is not very good thing. For example, when there are measured values 0.001, 1.000, 0.001 and 0.001, the result will be 0.25075, whereas I think that there should be some logic, which skips obviously bad value 1.000, and result should be 0.001.
The text was updated successfully, but these errors were encountered: