diff options
Diffstat (limited to 'web/attachments/177459-check_ntp.diff')
-rw-r--r-- | web/attachments/177459-check_ntp.diff | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/web/attachments/177459-check_ntp.diff b/web/attachments/177459-check_ntp.diff new file mode 100644 index 0000000..da11eb4 --- /dev/null +++ b/web/attachments/177459-check_ntp.diff | |||
@@ -0,0 +1,27 @@ | |||
1 | --- check_ntp 2006-04-28 07:19:01.546010471 +0200 | ||
2 | +++ check_ntp.modified 2006-04-28 07:02:45.236824995 +0200 | ||
3 | @@ -56,6 +56,10 @@ | ||
4 | # changed ntpdc to ntpq - jitter/dispersion is in milliseconds | ||
5 | # | ||
6 | # Patch for for regex for stratum1 refid. | ||
7 | +# | ||
8 | +# Script modified 2006 April 28 by Johan Nilsson (johan.nilsson@axis.com) | ||
9 | +# o Modified script to handle case when ntpdate reports time, but ntpq times out | ||
10 | +# | ||
11 | |||
12 | require 5.004; | ||
13 | use POSIX; | ||
14 | @@ -427,8 +431,11 @@ | ||
15 | |||
16 | foreach my $key (keys %ERRORS) { | ||
17 | if ($state==$ERRORS{$key}) { | ||
18 | -# print ("NTP $key: $answer"); | ||
19 | - print ("NTP $key: $answer|offset=$offset, jitter=" . $jitter/1000 . ",peer_stratum=$stratum\n"); | ||
20 | + if ( defined($jitter) ) { | ||
21 | + print ("NTP $key: $answer|offset=$offset, jitter=" . $jitter/1000 . ",peer_stratum=$stratum\n"); | ||
22 | + } else { | ||
23 | + print ("NTP $key: $answer"); | ||
24 | + }; | ||
25 | last; | ||
26 | } | ||
27 | } | ||