summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp_peer.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2007-11-26 10:34:43 +0000
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2007-11-26 10:34:43 +0000
commitef1f4e1e69338e5611a80b1110131b528377f624 (patch)
treee80e02930b0bfbecf06c7ced0dbd002af57b1e3d /plugins/check_ntp_peer.c
parentef1863eed928df0933148ad1bc613618cd93a0cc (diff)
downloadmonitoring-plugins-ef1f4e1e69338e5611a80b1110131b528377f624.tar.gz
Fix bug introduced in last commit: jitter and stratum must be initialized at the begining (and /me must have some rest now).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/dermoth_ntp_rework@1836 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ntp_peer.c')
-rw-r--r--plugins/check_ntp_peer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c
index 5d21832b..a70e88ce 100644
--- a/plugins/check_ntp_peer.c
+++ b/plugins/check_ntp_peer.c
@@ -234,6 +234,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
234 234
235 status = STATE_OK; 235 status = STATE_OK;
236 *offset_result = STATE_UNKNOWN; 236 *offset_result = STATE_UNKNOWN;
237 *jitter = *stratum = -1;
237 238
238 /* Long-winded explanation: 239 /* Long-winded explanation:
239 * Getting the sync peer offset, jitter and stratum requires a number of 240 * Getting the sync peer offset, jitter and stratum requires a number of
@@ -576,7 +577,7 @@ int main(int argc, char *argv[]){
576 break; 577 break;
577 } 578 }
578 if(!syncsource_found) 579 if(!syncsource_found)
579 asprintf(&result_line, "%s %s, ", result_line, _("Server not synchronized")); 580 asprintf(&result_line, "%s %s,", result_line, _("Server not synchronized"));
580 581
581 if(offset_result == STATE_UNKNOWN){ 582 if(offset_result == STATE_UNKNOWN){
582 asprintf(&result_line, "%s %s", result_line, _("Offset unknown")); 583 asprintf(&result_line, "%s %s", result_line, _("Offset unknown"));