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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
10,19c10
< # $Id: check_ntp.pl,v 1.30 2005/02/09 11:15 mevertse Exp $
< #
< # (c) 2005 Merijn Evertse, SARA Computing and Networking Services
< # 9-2-2005, 11:15
< #
< # Modified the script to accept parameters -4, -6 to choose between the ipv4 and ipv6 protocol.
< # When no parameter is specified ipv4 is chosen as the default.
< #
< # (c) 2004 Matthew Kent
< # 19-11-2004, 04:00
---
> # $Id: check_ntp.pl,v 1.20 2004/11/19 03:59:43 mattkent Exp $
73,74c64,65
< use vars qw($opt_V $opt_h $opt_H $opt_t $opt_w $opt_c $opt_j $opt_k $verbose $PROGNAME $def_jitter $ipv4 $ipv6);
< use lib utils.pm;
---
> use vars qw($opt_V $opt_h $opt_H $opt_t $opt_w $opt_c $opt_j $opt_k $verbose $PROGNAME $def_jitter);
> use lib utils.pm;
97,99c88
< "v" => \$verbose, "verbose" => \$verbose,
< "4" => \$ipv4, "use-ipv4" => \$ipv4,
< "6" => \$ipv6, "use-ipv6" => \$ipv6,
---
> "v" => \$verbose, "verbose" => \$verbose,
191,206d179
< # Determine protocol te be used for ntpdate and ntpq
< my $ntpdate;
< my $ntpq;
< if ($ipv4) {
< $ntpdate = $utils::PATH_TO_NTPDATE . " -4";
< $ntpq = $utils::PATH_TO_NTPQ . " -4";
< }
< elsif ($ipv6) {
< $ntpdate = $utils::PATH_TO_NTPDATE . " -6";
< $ntpq = $utils::PATH_TO_NTPQ . " -6";
< }
< else {
< # Use IPv4 as the default value
< $ntpdate = $utils::PATH_TO_NTPDATE . " -4";
< $ntpq = $utils::PATH_TO_NTPQ . " -4";
< }
214c187
< if (!open (NTPDATE, $ntpdate . " -q $host 2>&1 |")) {
---
> if (!open (NTPDATE, "$utils::PATH_TO_NTPDATE -q $host 2>&1 |")) {
289c262
< if ( open(NTPQ, $ntpq . " -np $host 2>&1 |") ) {
---
> if ( open(NTPQ,"$utils::PATH_TO_NTPQ -np $host 2>&1 |") ) {
439c412
< print "Usage: $PROGNAME -H <host> [-46] [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n";
---
> print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n";
457c430
< Clock jitter in milliseconds at which a warning message will be generated.\n Defaults to $DEFAULT_JITTER_CRIT.
---
> Clock jitter in milliseconds at which a warning message will be generated.\n Defaults to $DEFAULT_JITTER_CRIT.\n
460,465c433,434
< warning is returned.\n
< -4 (--use-ipv4)
< Use IPv4 connection
< -6 (--use-ipv6)
< Use IPv6 connection
< \n";
---
> warning is returned.
> ";
|