From 2acc26005c5395a96304e7a9e348b2e87f9e45c6 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Thu, 25 Oct 2007 21:06:08 +0000 Subject: check_ntp now return UNKNOWN instead of WARNING if jitter is unavailable. If no offset threshold is specified and the offset is unavailable, will return UNKNOWN as well. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1811 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/NEWS b/NEWS index 361443b..99739a7 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,11 @@ This file documents the major additions and syntax changes between releases. Fix check_http regression in 1.4.10 where following redirects to relative URLs on virtual hosts failed if both "-H" and "-I" were used Add stratum thresholds support to check_ntp (feature request #1703823) + check_ntp now return UNKNOWN instead of WARNING if jitter is unavailable (jitter=-1.000000) + as long as the thresholds range inculde -1. If no offset threshold is specified + and the offset is unavailable, will return UNKNOWN as well. + NOTE: If jitter thresholds are specified integers it will return CRITICAL if jitter + is "-1" as the default range starts at 0. See Examples in --help output. 1.4.10 28th September 2007 Fix check_http buffer overflow vulnerability when following HTTP redirects diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 12334f7..df6e02f 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c @@ -47,6 +47,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; static char *server_address=NULL; static int verbose=0; +static short do_offset=0; static char *owarn="60"; static char *ocrit="120"; static short do_stratum=0; @@ -479,7 +480,7 @@ double offset_request(const char *host, int *stratum, int *status){ /* now, pick the best server from the list */ best_index=best_offset_server(servers, num_hosts); if(best_index < 0){ - *status=STATE_CRITICAL; + *status=STATE_UNKNOWN; } else { /* finally, calculate the average offset */ for(i=0; i