blob: 459819e3cdaf60f7b887b72c8c3e22205803c718 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
$NetBSD: patch-ac,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
--- node/node.d/ntp_.in.orig 2004-11-21 21:19:09.000000000 +0100
+++ node/node.d/ntp_.in
@@ -76,6 +76,8 @@ $0 =~ /ntp_(.+)*$/;
my $name = $1;
exit 2 unless defined $name;
+my $do_delay = ! defined($ENV{'NTP_NODELAY'});
+
if ($ARGV[0] and $ARGV[0] eq "config") {
my @lines = `ntpq -c "hostnames no" -c peers`;
my $host;
@@ -91,8 +93,10 @@ if ($ARGV[0] and $ARGV[0] eq "config") {
print "graph_title NTP statistics for peer $host\n";
}
print "graph_args --base 1000 --vertical-label msec --lower-limit 0\n";
- print "delay.label Delay\n";
- print "delay.draw LINE2\n";
+ if ($do_delay) {
+ print "delay.label Delay\n";
+ print "delay.draw LINE2\n";
+ }
print "offset.label Offset\n";
print "offset.draw LINE2\n";
print "jitter.label Jitter\n";
@@ -110,8 +114,12 @@ foreach (@lines) {
$host =~ s/[\.-]/_/g;
next unless $host eq $name;
my @F = split;
- print <<"EOT";
+if ($do_delay) {
+ print <<"EOT"
delay.value $F[7]
+EOT
+}
+ print <<"EOT";
offset.value $F[8]
jitter.value $F[9]
EOT
|