summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba6b4ca)
raw | patch | inline | side by side (parent: ba6b4ca)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Tue, 11 Dec 2007 13:31:22 +0000 (13:31 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Tue, 11 Dec 2007 13:31:22 +0000 (13:31 +0000) |
- 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
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1864 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_ntp_peer.c | patch | blob | history | |
plugins/t/check_ntp.t | patch | blob | history |
index b5551ba8d64f9af7b431708d6c537cfd44eafe15..3e518bc23503a7d1c6fd3202587161c7b0e2a14d 100644 (file)
--- 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.
diff --git a/plugins/t/check_ntp.t b/plugins/t/check_ntp.t
index ae7f0369295dced1157fa490277f8893d09834aa..01a890e39a4f1590dd9e422636fc2b6423ac5ea5 100644 (file)
--- a/plugins/t/check_ntp.t
+++ b/plugins/t/check_ntp.t
like( $res->output, $ntp_okmatch2, "$plugin: Output match OK with jitter and stratum" );
$res = NPTest->testCmd(
- "./$plugin -H $ntp_service -w 1000 -c 2000 -W ~:-1 -C 21 -j 100000 -k 200000"
+ "./$plugin -H $ntp_service -w 1000 -c 2000 -W \~:-1 -C 21 -j 100000 -k 200000"
);
cmp_ok( $res->return_code, '==', 1, "$plugin: Warning NTP result with jitter and stratum check" );
like( $res->output, $ntp_warnmatch2, "$plugin: Output match WARNING with jitter and stratum" );
$res = NPTest->testCmd(
- "./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k ~:-1"
+ "./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k \~:-1"
);
cmp_ok( $res->return_code, '==', 2, "$plugin: Critical NTP result with jitter and stratum check" );
like( $res->output, $ntp_critmatch2, "$plugin: Output match CRITICAL with jitter and stratum" );