mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-22 14:46:57 -04:00
Fixing bug in average calculation (Submitted by Lars)
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 Closes #956 and Closes #1166 Closes: #1089
This commit is contained in:
parent
c5dc81cd28
commit
ccecba33a2
2 changed files with 2 additions and 2 deletions
|
|
@ -482,7 +482,7 @@ double offset_request(const char *host, int *status){
|
|||
} else {
|
||||
/* finally, calculate the average offset */
|
||||
for(i=0; i<servers[best_index].num_responses;i++){
|
||||
avg_offset+=servers[best_index].offset[j];
|
||||
avg_offset+=servers[best_index].offset[i];
|
||||
}
|
||||
avg_offset/=servers[best_index].num_responses;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ double offset_request(const char *host, int *status){
|
|||
} else {
|
||||
/* finally, calculate the average offset */
|
||||
for(i=0; i<servers[best_index].num_responses;i++){
|
||||
avg_offset+=servers[best_index].offset[j];
|
||||
avg_offset+=servers[best_index].offset[i];
|
||||
}
|
||||
avg_offset/=servers[best_index].num_responses;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue