aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_ntp_peer.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2007-12-11 13:31:22 +0000
committerGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2007-12-11 13:31:22 +0000
commit8cb50065632541ea83097d02182385910ee37a8c (patch)
tree5c78dfd1f2d853fe8acd7712433273bc4f21b05f /plugins/check_ntp_peer.c
parentba6b4cab4125b5f07f6e37c8504824850425267f (diff)
downloadmonitoring-plugins-8cb50065632541ea83097d02182385910ee37a8c.tar.gz
- Fix check_ntp_peer returning misleading information when an ICMP message came back
- Try to fix some servers apparently exanding the ~ in threshold ranges in t/check_ntp.t git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1864 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 b5551ba8..3e518bc2 100644
--- a/plugins/check_ntp_peer.c
+++ b/plugins/check_ntp_peer.c
@@ -264,7 +264,8 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji
/* Attempt to read the largest size packet possible */
req.count=htons(MAX_CM_SIZE);
DBG(printf("recieving READSTAT response"))
- read(conn, &req, SIZEOF_NTPCM(req));
+ if(read(conn, &req, SIZEOF_NTPCM(req)) == -1)
+ die(STATE_CRITICAL, "NTP CRITICAL: No response from NTP server\n");
DBG(print_ntp_control_message(&req));
/* Each peer identifier is 4 bytes in the data section, which
* we represent as a ntp_assoc_status_pair datatype.