[ nagiosplug-Bugs-3552882 ] check_ntp_time and check_ntp return just first offset
SourceForge.net <[email protected]>
| Newsgroups | gmane.network.nagios.plugins.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3552882, was opened at 2012-07-31 17:54
Message generated for change (Tracker Item Submitted) made by
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3552882&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: General plugin execution
Group: snapshot tarball
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: https://www.google.com/accounts ()
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ntp_time and check_ntp return just first offset
Initial Comment:
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:
for(i=0; i<servers[best_index].num_responses;i++){
avg_offset+=servers[best_index].offset[j];
}
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3552882&group_id=29880
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null