[Nagiosplug-checkins] SF.net SVN: nagiosplug: [1864] nagiosplug/trunk/plugins

dermoth at users.sourceforge.net dermoth at users.sourceforge.net
Tue Dec 11 14:31:22 CET 2007


Revision: 1864
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1864&view=rev
Author:   dermoth
Date:     2007-12-11 05:31:22 -0800 (Tue, 11 Dec 2007)

Log Message:
-----------
- 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

Modified Paths:
--------------
    nagiosplug/trunk/plugins/check_ntp_peer.c
    nagiosplug/trunk/plugins/t/check_ntp.t

Modified: nagiosplug/trunk/plugins/check_ntp_peer.c
===================================================================
--- nagiosplug/trunk/plugins/check_ntp_peer.c	2007-12-11 12:05:16 UTC (rev 1863)
+++ nagiosplug/trunk/plugins/check_ntp_peer.c	2007-12-11 13:31:22 UTC (rev 1864)
@@ -264,7 +264,8 @@
 		/* 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.

Modified: nagiosplug/trunk/plugins/t/check_ntp.t
===================================================================
--- nagiosplug/trunk/plugins/t/check_ntp.t	2007-12-11 12:05:16 UTC (rev 1863)
+++ nagiosplug/trunk/plugins/t/check_ntp.t	2007-12-11 13:31:22 UTC (rev 1864)
@@ -97,13 +97,13 @@
 		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" );


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list