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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
|
<html lang="en">
<head>
<title>ntpq: Network Time Protocol Query User's Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="ntpq: Network Time Protocol Query User's Manual">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family: serif; font-weight: normal; }
--></style>
</head>
<body>
<h1 class="settitle">ntpq: Network Time Protocol Query User's Manual</h1>
<div class="shortcontents">
<h2>Short Contents</h2>
<ul>
<a href="#Top">ntpq: Network Time Protocol Query User Manual</a>
</ul>
</div>
<div class="node">
<p><hr>
<a name="Top"></a>Next: <a rel="next" accesskey="n" href="#ntpq-Description">ntpq Description</a>,
Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
</div>
<h2 class="unnumbered">ntpq: Network Time Protocol Query User Manual</h2>
<p>The <code>ntpq</code> utility program is used to
monitor the operational status
and determine the performance of
<code>ntpd</code>, the NTP daemon.
<p>This document applies to version 4.2.8p7 of <code>ntpq</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpq-Description">ntpq Description</a>
<li><a accesskey="2" href="#ntpq-Invocation">ntpq Invocation</a>: Invoking ntpq
<li><a accesskey="3" href="#Usage">Usage</a>
<li><a accesskey="4" href="#Internal-Commands">Internal Commands</a>
<li><a accesskey="5" href="#Control-Message-Commands">Control Message Commands</a>
<li><a accesskey="6" href="#Status-Words-and-Kiss-Codes">Status Words and Kiss Codes</a>
<li><a accesskey="7" href="#System-Variables">System Variables</a>
<li><a accesskey="8" href="#Peer-Variables">Peer Variables</a>
<li><a accesskey="9" href="#Clock-Variables">Clock Variables</a>
</ul>
<div class="node">
<p><hr>
<a name="ntpq-Description"></a>Next: <a rel="next" accesskey="n" href="#Usage">Usage</a>,
Previous: <a rel="previous" accesskey="p" href="#Top">Top</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Description</h3>
<p>The <code>ntpq</code> utility program is used to monitor NTP daemon <code>ntpd</code> operations and determine performance.
It uses the standard NTP mode 6 control message formats defined in
Appendix B of the NTPv3 specification RFC1305.
The same formats are used in NTPv4, although some of the variable names have changed and new ones added.
The description on this page is for the NTPv4 variables.
<p>The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The <code>ntpq</code> can also obtain and print a list of peers in a common format by sending multiple queries to the server.
<p>If one or more request options is included on the command line when <code>ntpq</code> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, <code>ntpq</code> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. <code>ntpq</code> will prompt for commands if the standard input is a terminal device.
<p><code>ntpq</code> uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. <code>ntpq</code> makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.
<p>Note that in contexts where a host name is expected, a <code>-4</code> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <code>-6</code> qualifier forces DNS resolution to the IPv6 namespace.
<p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.
<div class="node">
<p><hr>
<a name="ntpq-Invocation"></a>
<br>
</div>
<h3 class="section">Invoking ntpq</h3>
<p><a name="index-ntpq-1"></a><a name="index-standard-NTP-query-program-2"></a>
<p>The
<code>ntpq</code>
utility program is used to query NTP servers which
implement the standard NTP mode 6 control message formats defined
in Appendix B of the NTPv3 specification RFC1305, requesting
information about current state and/or changes in that state.
The same formats are used in NTPv4, although some of the
variables have changed and new ones added. The description on this
page is for the NTPv4 variables.
The program may be run either in interactive mode or controlled using
command line arguments.
Requests to read and write arbitrary
variables can be assembled, with raw and pretty-printed output
options being available.
The
<code>ntpq</code>
utility can also obtain and print a
list of peers in a common format by sending multiple queries to the
server.
<p>If one or more request options is included on the command line
when
<code>ntpq</code>
is executed, each of the requests will be sent
to the NTP servers running on each of the hosts given as command
line arguments, or on localhost by default.
If no request options
are given,
<code>ntpq</code>
will attempt to read commands from the
standard input and execute these on the NTP server running on the
first host given on the command line, again defaulting to localhost
when no other host is specified.
The
<code>ntpq</code>
utility will prompt for
commands if the standard input is a terminal device.
<p><code>ntpq</code>
uses NTP mode 6 packets to communicate with the
NTP server, and hence can be used to query any compatible server on
the network which permits it.
Note that since NTP is a UDP protocol
this communication will be somewhat unreliable, especially over
large distances in terms of network topology.
The
<code>ntpq</code>
utility makes
one attempt to retransmit requests, and will time requests out if
the remote host is not heard from within a suitable timeout
time.
<p>Specifying a
command line option other than
<code>-i</code>
or
<code>-n</code>
will
cause the specified query (queries) to be sent to the indicated
host(s) immediately.
Otherwise,
<code>ntpq</code>
will attempt to read
interactive format commands from the standard input.
<h5 class="subsubsection">Internal Commands</h5>
<p>Interactive format commands consist of a keyword followed by zero
to four arguments.
Only enough characters of the full keyword to
uniquely identify the command need be typed.
<p>A
number of interactive format commands are executed entirely within
the
<code>ntpq</code>
utility itself and do not result in NTP mode 6
requests being sent to a server.
These are described following.
<dl>
<dt><code>?</code> <code>[</code><kbd>command_keyword</kbd><code>]</code><br><dt><code>help</code> <code>[</code><kbd>command_keyword</kbd><code>]</code><dd>A
?
by itself will print a list of all the command
keywords known to this incarnation of
<code>ntpq</code>
A
?
followed by a command keyword will print function and usage
information about the command.
This command is probably a better
source of information about
<code>ntpq</code>
than this manual
page.
<br><dt><code>addvars</code> <kbd>variable_name</kbd><code>[=value]</code> <code>...</code><br><dt><code>rmvars</code> <kbd>variable_name</kbd> <code>...</code><br><dt><code>clearvars</code><br><dt><code>showvars</code><dd>The data carried by NTP mode 6 messages consists of a list of
items of the form
variable_name=value,
where the
=value
is ignored, and can be omitted,
in requests to the server to read variables.
The
<code>ntpq</code>
utility maintains an internal list in which data to be included in control
messages can be assembled, and sent using the
<code>readlist</code>
and
<code>writelist</code>
commands described below.
The
<code>addvars</code>
command allows variables and their optional values to be added to
the list.
If more than one variable is to be added, the list should
be comma-separated and not contain white space.
The
<code>rmvars</code>
command can be used to remove individual variables from the list,
while the
<code>clearlist</code>
command removes all variables from the
list.
The
<code>showvars</code>
command displays the current list of optional variables.
<br><dt><code>authenticate</code> <code>[yes | no]</code><dd>Normally
<code>ntpq</code>
does not authenticate requests unless
they are write requests.
The command
authenticate yes
causes
<code>ntpq</code>
to send authentication with all requests it
makes.
Authenticated requests causes some servers to handle
requests slightly differently, and can occasionally melt the CPU in
fuzzballs if you turn authentication on before doing a
<code>peer</code>
display.
The command
authenticate
causes
<code>ntpq</code>
to display whether or not
<code>ntpq</code>
is currently autheinticating requests.
<br><dt><code>cooked</code><dd>Causes output from query commands to be "cooked", so that
variables which are recognized by
<code>ntpq</code>
will have their
values reformatted for human consumption.
Variables which
<code>ntpq</code>
thinks should have a decodable value but didn't are
marked with a trailing
?.
<br><dt><code>debug</code> <code>[more | less | off]</code><dd>With no argument, displays the current debug level.
Otherwise, the debug level is changed to the indicated level.
<br><dt><code>delay</code> <kbd>milliseconds</kbd><dd>Specify a time interval to be added to timestamps included in
requests which require authentication.
This is used to enable
(unreliable) server reconfiguration over long delay network paths
or between machines whose clocks are unsynchronized.
Actually the
server does not now require timestamps in authenticated requests,
so this command may be obsolete.
<br><dt><code>exit</code><dd>Exit
<code>ntpq</code>
<br><dt><code>host</code> <kbd>hostname</kbd><dd>Set the host to which future queries will be sent.
<kbd>hostname</kbd>
may be either a host name or a numeric address.
<br><dt><code>hostnames</code> <code>[yes | no]</code><dd>If
<code>yes</code>
is specified, host names are printed in
information displays.
If
<code>no</code>
is specified, numeric
addresses are printed instead.
The default is
<code>yes</code>,
unless
modified using the command line
<code>-n</code>
switch.
<br><dt><code>keyid</code> <kbd>keyid</kbd><dd>This command allows the specification of a key number to be
used to authenticate configuration requests.
This must correspond
to the
<code>controlkey</code>
key number the server has been configured to use for this
purpose.
<br><dt><code>keytype</code> <code>[md5 | OpenSSLDigestType]</code><dd>Specify the type of key to use for authenticating requests.
<code>md5</code>
is alway supported.
If
<code>ntpq</code>
was built with OpenSSL support,
any digest type supported by OpenSSL can also be provided.
If no argument is given, the current
<code>keytype</code>
is displayed.
<br><dt><code>ntpversion</code> <code>[1 | 2 | 3 | 4]</code><dd>Sets the NTP version number which
<code>ntpq</code>
claims in
packets.
Defaults to 3, and note that mode 6 control messages (and
modes, for that matter) didn't exist in NTP version 1.
There appear
to be no servers left which demand version 1.
With no argument, displays the current NTP version that will be used
when communicating with servers.
<br><dt><code>passwd</code><dd>This command prompts you to type in a password (which will not
be echoed) which will be used to authenticate configuration
requests.
The password must correspond to the key configured for
use by the NTP server for this purpose if such requests are to be
successful.
<code>poll</code>
<kbd>n</kbd>
<code>verbose</code>
<br><dt><code>quit</code><dd>Exit
<code>ntpq</code>
<br><dt><code>raw</code><dd>Causes all output from query commands is printed as received
from the remote server.
The only formating/interpretation done on
the data is to transform nonascii data into a printable (but barely
understandable) form.
<br><dt><code>timeout</code> <kbd>milliseconds</kbd><dd>Specify a timeout period for responses to server queries.
The
default is about 5000 milliseconds.
Note that since
<code>ntpq</code>
retries each query once after a timeout, the total waiting time for
a timeout will be twice the timeout value set.
<br><dt><code>version</code><dd>Print the version of the
<code>ntpq</code>
program.
</dl>
<h5 class="subsubsection">Control Message Commands</h5>
<p>Association IDs are used to identify system, peer and clock variables.
System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
Most control commands send a single mode-6 message to the server and expect a single response message.
The exceptions are the
<code>peers</code>
command, which sends a series of messages,
and the
<code>mreadlist</code>
and
<code>mreadvar</code>
commands, which iterate over a range of associations.
<dl>
<dt><code>associations</code><dd>Display a list of mobilized associations in the form:
<pre class="example"> ind assid status conf reach auth condition last_event cnt
</pre>
<dl>
<dt>Sy String Ta Sy Description<br><dt><code>ind</code> <code>Ta</code> <code>index</code> <code>on</code> <code>this</code> <code>list</code><br><dt><code>assid</code> <code>Ta</code> <code>association</code> <code>ID</code><br><dt><code>status</code> <code>Ta</code> <code>peer</code> <code>status</code> <code>word</code><br><dt><code>conf</code> <code>Ta</code> <code>yes</code>: <code>persistent,</code> <code>no</code>: <code>ephemeral</code><br><dt><code>reach</code> <code>Ta</code> <code>yes</code>: <code>reachable,</code> <code>no</code>: <code>unreachable</code><br><dt><code>auth</code> <code>Ta</code> <code>ok</code>, <code>yes</code>, <code>bad</code> <code>and</code> <code>none</code><br><dt><code>condition</code> <code>Ta</code> <code>selection</code> <code>status</code> <code>(see</code> <code>the</code> <code>select</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code><br><dt><code>last_event</code> <code>Ta</code> <code>event</code> <code>report</code> <code>(see</code> <code>the</code> <code>event</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code><br><dt><code>cnt</code> <code>Ta</code> <code>event</code> <code>count</code> <code>(see</code> <code>the</code> <code>count</code> <code>field</code> <code>of</code> <code>the</code> <code>peer</code> <code>status</code> <code>word)</code><dd></dl>
<br><dt><code>authinfo</code><dd>Display the authentication statistics.
<br><dt><code>clockvar</code> <kbd>assocID</kbd> <code>[</code><kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]]</code> <code>[...]</code><br><dt><code>cv</code> <kbd>assocID</kbd> <code>[</code><kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]]</code> <code>[...]</code><dd>Display a list of clock variables for those associations supporting a reference clock.
<br><dt><code>:config</code> <code>[...]</code><dd>Send the remainder of the command line, including whitespace, to the server as a run-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
<br><dt><code>config-from-file</code> <kbd>filename</kbd><dd>Send the each line of
<kbd>filename</kbd>
to the server as run-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
<br><dt><code>ifstats</code><dd>Display statistics for each local network address. Authentication is required.
<br><dt><code>iostats</code><dd>Display network and reference clock I/O statistics.
<br><dt><code>kerninfo</code><dd>Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
<br><dt><code>lassociations</code><dd>Perform the same function as the associations command, except display mobilized and unmobilized associations.
<br><dt><code>lopeers</code> <code>[-4 | -6]</code><dd>Obtain and print a list of all peers and clients showing
<kbd>dstadr</kbd>
(associated with any given IP version).
<br><dt><code>lpeers</code> <code>[-4 | -6]</code><dd>Print a peer spreadsheet for the appropriate IP version(s).
<kbd>dstadr</kbd>
(associated with any given IP version).
<br><dt><code>monstats</code><dd>Display monitor facility statistics.
<br><dt><code>mrulist</code> <code>[limited | kod | mincount=</code><kbd>count</kbd><code> | laddr=</code><kbd>localaddr</kbd><code> | sort=</code><kbd>sortorder</kbd><code> | resany=</code><kbd>hexmask</kbd><code> | resall=</code><kbd>hexmask</kbd><code>]</code><dd>Obtain and print traffic counts collected and maintained by the monitor facility.
With the exception of
<code>sort</code>=<kbd>sortorder</kbd>,
the options filter the list returned by
<code>ntpd.</code>
The
<code>limited</code>
and
<code>kod</code>
options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
The
<code>mincount</code>=<kbd>count</kbd>
option filters entries representing less than
<kbd>count</kbd>
packets.
The
<code>laddr</code>=<kbd>localaddr</kbd>
option filters entries for packets received on any local address other than
<kbd>localaddr</kbd>.
<code>resany</code>=<kbd>hexmask</kbd>
and
<code>resall</code>=<kbd>hexmask</kbd>
filter entries containing none or less than all, respectively, of the bits in
<kbd>hexmask</kbd>,
which must begin with
<code>0x</code>.
The
<kbd>sortorder</kbd>
defaults to
<code>lstint</code>
and may be any of
<code>addr</code>,
<code>count</code>,
<code>avgint</code>,
<code>lstint</code>,
or any of those preceded by a minus sign (hyphen) to reverse the sort order.
The output columns are:
<dl>
<dt>Column<dd>Description
<br><dt><code>lstint</code><dd>Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
<code>ntpq</code>
<br><dt><code>avgint</code><dd>Average interval in s between packets from this address.
<br><dt><code>rstr</code><dd>Restriction flags associated with this address.
Most are copied unchanged from the matching
<code>restrict</code>
command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
<br><dt><code>r</code><dd>Rate control indicator, either
a period,
<code>L</code>
or
<code>K</code>
for no rate control response,
rate limiting by discarding, or rate limiting with a KoD response, respectively.
<br><dt><code>m</code><dd>Packet mode.
<br><dt><code>v</code><dd>Packet version number.
<br><dt><code>count</code><dd>Packets received from this address.
<br><dt><code>rport</code><dd>Source port of last packet from this address.
<br><dt><code>remote</code> <code>address</code><dd>DNS name, numeric address, or address followed by
claimed DNS name which could not be verified in parentheses.
</dl>
<br><dt><code>mreadvar</code> <code>assocID</code> <code>assocID</code> <code>[</code><kbd>variable_name</kbd><code>[=</code><kbd>value</kbd><code>] ...]</code><br><dt><code>mrv</code> <code>assocID</code> <code>assocID</code> <code>[</code><kbd>variable_name</kbd><code>[=</code><kbd>value</kbd><code>] ...]</code><dd>Perform the same function as the
<code>readvar</code>
command, except for a range of association IDs.
This range is determined from the association list cached by the most recent
<code>associations</code>
command.
<br><dt><code>opeers</code> <code>[-4 | -6]</code><dd>Obtain and print the old-style list of all peers and clients showing
<kbd>dstadr</kbd>
(associated with any given IP version),
rather than the
<kbd>refid</kbd>.
<br><dt><code>passociations</code><dd>Perform the same function as the
<code>associations</code>
command,
except that it uses previously stored data rather than making a new query.
<br><dt><code>peers</code><dd>Display a list of peers in the form:
<pre class="example"> [tally]remote refid st t when pool reach delay offset jitter
</pre>
<dl>
<dt>Variable<dd>Description
<br><dt><code>[tally]</code><dd>single-character code indicating current value of the
<code>select</code>
field of the
.Lk decode.html#peer "peer status word"
<br><dt><code>remote</code><dd>host name (or IP number) of peer.
The value displayed will be truncated to 15 characters unless the
<code>-w</code>
flag is given, in which case the full value will be displayed
on the first line,
and the remaining data is displayed on the next line.
<br><dt><code>refid</code><dd>association ID or
.Lk decode.html#kiss "'kiss code"
<br><dt><code>st</code><dd>stratum
<br><dt><code>t</code><dd><code>u</code>:
unicast or manycast client,
<code>b</code>:
broadcast or multicast client,
<code>l</code>:
local (reference clock),
<code>s</code>:
symmetric (peer),
<code>A</code>:
manycast server,
<code>B</code>:
broadcast server,
<code>M</code>:
multicast server
<br><dt><code>when</code><dd>sec/min/hr since last received packet
<br><dt><code>poll</code><dd>poll interval (log2 s)
<br><dt><code>reach</code><dd>reach shift register (octal)
<br><dt><code>delay</code><dd>roundtrip delay
<br><dt><code>offset</code><dd>offset of server relative to this host
<br><dt><code>jitter</code><dd>jitter
</dl>
<br><dt><code>apeers</code><dd>Display a list of peers in the form:
<pre class="example"> [tally]remote refid assid st t when pool reach delay offset jitter
</pre>
<p>where the output is just like the
<code>peers</code>
command except that the
<code>refid</code>
is displayed in hex format and the association number is also displayed.
<br><dt><code>pstats</code> <kbd>assocID</kbd><dd>Show the statistics for the peer with the given
<kbd>assocID</kbd>.
<br><dt><code>readlist</code> <kbd>assocID</kbd><br><dt><code>rl</code> <kbd>assocID</kbd><dd>Read the system or peer variables included in the variable list.
<br><dt><code>readvar</code> <kbd>assocID</kbd> <kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]</code> <code>[, ...]</code><br><dt><code>rv</code> <kbd>assocID</kbd> <kbd>name</kbd><code>[=</code><kbd>value</kbd><code>]</code> <code>[, ...]</code><dd>Display the specified variables.
If
<kbd>assocID</kbd>
is zero, the variables are from the
<a href="#System-Variables">System Variables</a>
name space, otherwise they are from the
<a href="#Peer-Variables">Peer Variables</a>
name space.
The
<kbd>assocID</kbd>
is required, as the same name can occur in both spaces.
If no
<kbd>name</kbd>
is included, all operative variables in the name space are displayed.
<p>In this case only, if the
<kbd>assocID</kbd>
is omitted, it is assumed zero.
Multiple names are specified with comma separators and without whitespace.
Note that time values are represented in milliseconds
and frequency values in parts-per-million (PPM).
Some NTP timestamps are represented in the format
YYYYMMDDTTTT ,
where YYYY is the year,
MM the month of year,
DD the day of month and
TTTT the time of day.
<br><dt><code>reslist</code><dd>Show the access control (restrict) list for
<code>ntpq</code>
<br><dt><code>saveconfig</code> <kbd>filename</kbd><dd>Write the current configuration,
including any runtime modifications given with
<code>:config</code>
or
<code>config-from-file</code>,
to the ntpd host's file
<kbd>filename</kbd>.
This command will be rejected by the server unless
.Lk miscopt.html#saveconfigdir "saveconfigdir"
appears in the
<code>ntpd</code>
configuration file.
<kbd>filename</kbd>
can use
<code>strftime()</code>
format specifies to substitute the current date and time, for example,
<code>q]saveconfig</code> <code>ntp-%Y%m%d-%H%M%S.confq]</code>.
The filename used is stored in system variable
<code>savedconfig</code>.
Authentication is required.
<br><dt><code>timerstats</code><dd>Display interval timer counters.
<br><dt><code>writelist</code> <kbd>assocID</kbd><dd>Write the system or peer variables included in the variable list.
<br><dt><code>writevar</code> <kbd>assocID</kbd> <kbd>name</kbd>=<kbd>value</kbd> <code>[, ...]</code><dd>Write the specified variables.
If the
<kbd>assocID</kbd>
is zero, the variables are from the
<a href="#System-Variables">System Variables</a>
name space, otherwise they are from the
<a href="#Peer-Variables">Peer Variables</a>
name space.
The
<kbd>assocID</kbd>
is required, as the same name can occur in both spaces.
<br><dt><code>sysinfo</code><dd>Display operational summary.
<br><dt><code>sysstats</code><dd>Print statistics counters maintained in the protocol module.
</dl>
<h5 class="subsubsection">Status Words and Kiss Codes</h5>
<p>The current state of the operating program is shown
in a set of status words
maintained by the system.
Status information is also available on a per-association basis.
These words are displayed in the
<code>rv</code>
and
<code>as</code>
commands both in hexadecimal and in decoded short tip strings.
The codes, tips and short explanations are documented on the
.Lk decode.html "Event Messages and Status Words"
page.
The page also includes a list of system and peer messages,
the code for the latest of which is included in the status word.
<p>Information resulting from protocol machine state transitions
is displayed using an informal set of ASCII strings called
.Lk decode.html#kiss "kiss codes" .
The original purpose was for kiss-o'-death (KoD) packets
sent by the server to advise the client of an unusual condition.
They are now displayed, when appropriate,
in the reference identifier field in various billboards.
<h5 class="subsubsection">System Variables</h5>
<p>The following system variables appear in the
<code>rv</code>
billboard.
Not all variables are displayed in some configurations.
<dl>
<dt>Variable<dd>Description
<br><dt><code>status</code><dd>.Lk decode.html#sys "system status word"
<br><dt><code>version</code><dd>NTP software version and build time
<br><dt><code>processor</code><dd>hardware platform and version
<br><dt><code>system</code><dd>operating system and version
<br><dt><code>leap</code><dd>leap warning indicator (0-3)
<br><dt><code>stratum</code><dd>stratum (1-15)
<br><dt><code>precision</code><dd>precision (log2 s)
<br><dt><code>rootdelay</code><dd>total roundtrip delay to the primary reference clock
<br><dt><code>rootdisp</code><dd>total dispersion to the primary reference clock
<br><dt><code>peer</code><dd>system peer association ID
<br><dt><code>tc</code><dd>time constant and poll exponent (log2 s) (3-17)
<br><dt><code>mintc</code><dd>minimum time constant (log2 s) (3-10)
<br><dt><code>clock</code><dd>date and time of day
<br><dt><code>refid</code><dd>reference ID or
.Lk decode.html#kiss "kiss code"
<br><dt><code>reftime</code><dd>reference time
<br><dt><code>offset</code><dd>combined offset of server relative to this host
<br><dt><code>sys_jitter</code><dd>combined system jitter
<br><dt><code>frequency</code><dd>frequency offset (PPM) relative to hardware clock
<br><dt><code>clk_wander</code><dd>clock frequency wander (PPM)
<br><dt><code>clk_jitter</code><dd>clock jitter
<br><dt><code>tai</code><dd>TAI-UTC offset (s)
<br><dt><code>leapsec</code><dd>NTP seconds when the next leap second is/was inserted
<br><dt><code>expire</code><dd>NTP seconds when the NIST leapseconds file expires
</dl>
The jitter and wander statistics are exponentially-weighted RMS averages.
The system jitter is defined in the NTPv4 specification;
the clock jitter statistic is computed by the clock discipline module.
<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
additional system variables are displayed,
including some or all of the following,
depending on the particular Autokey dance:
<dl>
<dt>Variable<dd>Description
<br><dt><code>host</code><dd>Autokey host name for this host
<br><dt><code>ident</code><dd>Autokey group name for this host
<br><dt><code>flags</code><dd>host flags (see Autokey specification)
<br><dt><code>digest</code><dd>OpenSSL message digest algorithm
<br><dt><code>signature</code><dd>OpenSSL digest/signature scheme
<br><dt><code>update</code><dd>NTP seconds at last signature update
<br><dt><code>cert</code><dd>certificate subject, issuer and certificate flags
<br><dt><code>until</code><dd>NTP seconds when the certificate expires
</dl>
<h5 class="subsubsection">Peer Variables</h5>
<p>The following peer variables appear in the
<code>rv</code>
billboard for each association.
Not all variables are displayed in some configurations.
<dl>
<dt>Variable<dd>Description
<br><dt><code>associd</code><dd>association ID
<br><dt><code>status</code><dd>.Lk decode.html#peer "peer status word"
<br><dt><code>srcadr</code><dd>source (remote) IP address
<br><dt><code>srcport</code><dd>source (remote) port
<br><dt><code>dstadr</code><dd>destination (local) IP address
<br><dt><code>dstport</code><dd>destination (local) port
<br><dt><code>leap</code><dd>leap indicator (0-3)
<br><dt><code>stratum</code><dd>stratum (0-15)
<br><dt><code>precision</code><dd>precision (log2 s)
<br><dt><code>rootdelay</code><dd>total roundtrip delay to the primary reference clock
<br><dt><code>rootdisp</code><dd>total root dispersion to the primary reference clock
<br><dt><code>refid</code><dd>reference ID or
.Lk decode.html#kiss "kiss code"
<br><dt><code>reftime</code><dd>reference time
<br><dt><code>reach</code><dd>reach register (octal)
<br><dt><code>unreach</code><dd>unreach counter
<br><dt><code>hmode</code><dd>host mode (1-6)
<br><dt><code>pmode</code><dd>peer mode (1-5)
<br><dt><code>hpoll</code><dd>host poll exponent (log2 s) (3-17)
<br><dt><code>ppoll</code><dd>peer poll exponent (log2 s) (3-17)
<br><dt><code>headway</code><dd>headway (see
.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" )
<br><dt><code>flash</code><dd>.Lk decode.html#flash "flash status word"
<br><dt><code>offset</code><dd>filter offset
<br><dt><code>delay</code><dd>filter delay
<br><dt><code>dispersion</code><dd>filter dispersion
<br><dt><code>jitter</code><dd>filter jitter
<br><dt><code>ident</code><dd>Autokey group name for this association
<br><dt><code>bias</code><dd>unicast/broadcast bias
<br><dt><code>xleave</code><dd>interleave delay (see
.Lk xleave.html "NTP Interleaved Modes" )
</dl>
The
<code>bias</code>
variable is calculated when the first broadcast packet is received
after the calibration volley.
It represents the offset of the broadcast subgraph relative to the unicast subgraph.
The
<code>xleave</code>
variable appears only for the interleaved symmetric and interleaved modes.
It represents the internal queuing, buffering and transmission delays
for the preceding packet.
<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
additional peer variables are displayed, including the following:
<dl>
<dt>Variable<dd>Description
<br><dt><code>flags</code><dd>peer flags (see Autokey specification)
<br><dt><code>host</code><dd>Autokey server name
<br><dt><code>flags</code><dd>peer flags (see Autokey specification)
<br><dt><code>signature</code><dd>OpenSSL digest/signature scheme
<br><dt><code>initsequence</code><dd>initial key ID
<br><dt><code>initkey</code><dd>initial key index
<br><dt><code>timestamp</code><dd>Autokey signature timestamp
</dl>
<h5 class="subsubsection">Clock Variables</h5>
<p>The following clock variables appear in the
<code>cv</code>
billboard for each association with a reference clock.
Not all variables are displayed in some configurations.
<dl>
<dt>Variable<dd>Description
<br><dt><code>associd</code><dd>association ID
<br><dt><code>status</code><dd>.Lk decode.html#clock "clock status word"
<br><dt><code>device</code><dd>device description
<br><dt><code>timecode</code><dd>ASCII time code string (specific to device)
<br><dt><code>poll</code><dd>poll messages sent
<br><dt><code>noreply</code><dd>no reply
<br><dt><code>badformat</code><dd>bad format
<br><dt><code>baddata</code><dd>bad date or time
<br><dt><code>fudgetime1</code><dd>fudge time 1
<br><dt><code>fudgetime2</code><dd>fudge time 2
<br><dt><code>stratum</code><dd>driver stratum
<br><dt><code>refid</code><dd>driver reference ID
<br><dt><code>flags</code><dd>driver flags
</dl>
<p>This section was generated by <strong>AutoGen</strong>,
using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpq</code> program.
This software is released under the NTP license, <http://ntp.org/license>.
<ul class="menu">
<li><a accesskey="1" href="#ntpq-usage">ntpq usage</a>: ntpq help/usage (<span class="option">--help</span>)
<li><a accesskey="2" href="#ntpq-ipv4">ntpq ipv4</a>: ipv4 option (-4)
<li><a accesskey="3" href="#ntpq-ipv6">ntpq ipv6</a>: ipv6 option (-6)
<li><a accesskey="4" href="#ntpq-command">ntpq command</a>: command option (-c)
<li><a accesskey="5" href="#ntpq-interactive">ntpq interactive</a>: interactive option (-i)
<li><a accesskey="6" href="#ntpq-numeric">ntpq numeric</a>: numeric option (-n)
<li><a accesskey="7" href="#ntpq-old_002drv">ntpq old-rv</a>: old-rv option
<li><a accesskey="8" href="#ntpq-peers">ntpq peers</a>: peers option (-p)
<li><a accesskey="9" href="#ntpq-refid">ntpq refid</a>: refid option (-r)
<li><a href="#ntpq-wide">ntpq wide</a>: wide option (-w)
<li><a href="#ntpq-config">ntpq config</a>: presetting/configuring ntpq
<li><a href="#ntpq-exit-status">ntpq exit status</a>: exit status
</ul>
<div class="node">
<p><hr>
<a name="ntpq-usage"></a>Next: <a rel="next" accesskey="n" href="#ntpq-ipv4">ntpq ipv4</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">ntpq help/usage (<span class="option">--help</span>)</h4>
<p><a name="index-ntpq-help-3"></a>
This is the automatically generated usage text for ntpq.
<p>The text printed is the same whether selected with the <code>help</code> option
(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
the usage text by passing it through a pager program.
<code>more-help</code> is disabled on platforms without a working
<code>fork(2)</code> function. The <code>PAGER</code> environment variable is
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p6
Usage: ntpq [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
- prohibits the option 'ipv6'
-6 no ipv6 Force IPv6 DNS name resolution
- prohibits the option 'ipv4'
-c Str command run a command and exit
- may appear multiple times
-d no debug-level Increase debug verbosity level
- may appear multiple times
-D Num set-debug-level Set the debug verbosity level
- may appear multiple times
-i no interactive Force ntpq to operate in interactive mode
- prohibits these options:
command
peers
-n no numeric numeric host addresses
no old-rv Always output status line with readvar
-p no peers Print a list of the peers
- prohibits the option 'interactive'
-r KWd refid Set default display type for S2+ refids
-w no wide Display the full 'remote' value
opt version output version information and exit
-? no help display extended usage information and exit
-! no more-help extended usage information passed thru pager
-> opt save-opts save the option state to a config file
-< Str load-opts load options from a config file
- disabled as '--no-load-opts'
- may appear multiple times
Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
The following option preset mechanisms are supported:
- reading file $HOME/.ntprc
- reading file ./.ntprc
- examining environment variables named NTPQ_*
The valid "refid" option keywords are:
hash ipv4
or an integer from 0 through 1
Please send bug reports to: <http://bugs.ntp.org, bugs@ntp.org>
</pre>
<div class="node">
<p><hr>
<a name="ntpq-ipv4"></a>Next: <a rel="next" accesskey="n" href="#ntpq-ipv6">ntpq ipv6</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-usage">ntpq usage</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">ipv4 option (-4)</h4>
<p><a name="index-ntpq_002dipv4-4"></a>
This is the “force ipv4 dns name resolution” option.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>must not appear in combination with any of the following options:
ipv6.
</ul>
<p>Force DNS resolution of following host names on the command line
to the IPv4 namespace.
<div class="node">
<p><hr>
<a name="ntpq-ipv6"></a>Next: <a rel="next" accesskey="n" href="#ntpq-command">ntpq command</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-ipv4">ntpq ipv4</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">ipv6 option (-6)</h4>
<p><a name="index-ntpq_002dipv6-5"></a>
This is the “force ipv6 dns name resolution” option.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>must not appear in combination with any of the following options:
ipv4.
</ul>
<p>Force DNS resolution of following host names on the command line
to the IPv6 namespace.
<div class="node">
<p><hr>
<a name="ntpq-command"></a>Next: <a rel="next" accesskey="n" href="#ntpq-interactive">ntpq interactive</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-ipv6">ntpq ipv6</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">command option (-c)</h4>
<p><a name="index-ntpq_002dcommand-6"></a>
This is the “run a command and exit” option.
This option takes a string argument <span class="file">cmd</span>.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>may appear an unlimited number of times.
</ul>
<p>The following argument is interpreted as an interactive format command
and is added to the list of commands to be executed on the specified
host(s).
<div class="node">
<p><hr>
<a name="ntpq-interactive"></a>Next: <a rel="next" accesskey="n" href="#ntpq-numeric">ntpq numeric</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-command">ntpq command</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">interactive option (-i)</h4>
<p><a name="index-ntpq_002dinteractive-7"></a>
This is the “force ntpq to operate in interactive mode” option.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>must not appear in combination with any of the following options:
command, peers.
</ul>
<p>Force <code>ntpq</code> to operate in interactive mode.
Prompts will be written to the standard output and
commands read from the standard input.
<div class="node">
<p><hr>
<a name="ntpq-numeric"></a>Next: <a rel="next" accesskey="n" href="#ntpq-old_002drv">ntpq old-rv</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-interactive">ntpq interactive</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">numeric option (-n)</h4>
<p><a name="index-ntpq_002dnumeric-8"></a>
This is the “numeric host addresses” option.
Output all host addresses in dotted-quad numeric format rather than
converting to the canonical host names.
<div class="node">
<p><hr>
<a name="ntpq-old_002drv"></a>Next: <a rel="next" accesskey="n" href="#ntpq-peers">ntpq peers</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-numeric">ntpq numeric</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">old-rv option</h4>
<p><a name="index-ntpq_002dold_002drv-9"></a>
This is the “always output status line with readvar” option.
By default, <code>ntpq</code> now suppresses the <code>associd=...</code>
line that precedes the output of <code>readvar</code>
(alias <code>rv</code>) when a single variable is requested, such as
<code>ntpq -c "rv 0 offset"</code>.
This option causes <code>ntpq</code> to include both lines of output
for a single-variable <code>readvar</code>.
Using an environment variable to
preset this option in a script will enable both older and
newer <code>ntpq</code> to behave identically in this regard.
<div class="node">
<p><hr>
<a name="ntpq-peers"></a>Next: <a rel="next" accesskey="n" href="#ntpq-refid">ntpq refid</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-old_002drv">ntpq old-rv</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">peers option (-p)</h4>
<p><a name="index-ntpq_002dpeers-10"></a>
This is the “print a list of the peers” option.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>must not appear in combination with any of the following options:
interactive.
</ul>
<p>Print a list of the peers known to the server as well as a summary
of their state. This is equivalent to the 'peers' interactive command.
<div class="node">
<p><hr>
<a name="ntpq-refid"></a>Next: <a rel="next" accesskey="n" href="#ntpq-wide">ntpq wide</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-peers">ntpq peers</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">refid option (-r)</h4>
<p><a name="index-ntpq_002drefid-11"></a>
This is the “set default display type for s2+ refids” option.
This option takes a keyword argument.
<p class="noindent">This option has some usage constraints. It:
<ul>
<li>This option takes a keyword as its argument.
The argument sets an enumeration value that can be tested by comparing the option value macro (OPT_VALUE_REFID).
The available keywords are:
<pre class="example"> hash ipv4
</pre>
<p>or their numeric equivalent.</ul>
<p>Set the default display format for S2+ refids.
<div class="node">
<p><hr>
<a name="ntpq-wide"></a>Next: <a rel="next" accesskey="n" href="#ntpq-config">ntpq config</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-refid">ntpq refid</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">wide option (-w)</h4>
<p><a name="index-ntpq_002dwide-12"></a>
This is the “display the full 'remote' value” option.
Display the full value of the 'remote' value. If this requires
more than 15 characters, display the full value, emit a newline,
and continue the data display properly indented on the next line.
<div class="node">
<p><hr>
<a name="ntpq-config"></a>Next: <a rel="next" accesskey="n" href="#ntpq-exit-status">ntpq exit status</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-wide">ntpq wide</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">presetting/configuring ntpq</h4>
<p>Any option that is not marked as <i>not presettable</i> may be preset by
loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>NTPQ</code> and <code>NTPQ_<OPTION_NAME></code>. <code><OPTION_NAME></code> must be one of
the options listed above in upper case and segmented with underscores.
The <code>NTPQ</code> variable will be tokenized and parsed like
the command line. The remaining variables are tested for existence and their
values are treated like option arguments.
<p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
<ul>
<li>$HOME
<li>$PWD
</ul>
The environment variables <code>HOME</code>, and <code>PWD</code>
are expanded and replaced when <span class="file">ntpq</span> runs.
For any of these that are plain files, they are simply processed.
For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
within that directory and processed.
<p>Configuration files may be in a wide variety of formats.
The basic format is an option name followed by a value (argument) on the
same line. Values may be separated from the option name with a colon,
equal sign or simply white space. Values may be continued across multiple
lines by escaping the newline with a backslash.
<p>Multiple programs may also share the same initialization file.
Common options are collected at the top, followed by program specific
segments. The segments are separated by lines like:
<pre class="example"> [NTPQ]
</pre>
<p class="noindent">or by
<pre class="example"> <?program ntpq>
</pre>
<p class="noindent">Do not mix these styles within one configuration file.
<p>Compound values and carefully constructed string values may also be
specified using XML syntax:
<pre class="example"> <option-name>
<sub-opt>...&lt;...&gt;...</sub-opt>
</option-name>
</pre>
<p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
<pre class="example"> "...<...>..."
</pre>
<p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
the associated name/value pair list (see: optionFindValue).
<p>The command line options relating to configuration and/or usage help are:
<h5 class="subsubheading">version (-)</h5>
<p>Print the program version to standard out, optionally with licensing
information, then exit 0. The optional argument specifies how much licensing
detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
Only the first letter of the argument is examined:
<dl>
<dt><span class="samp">version</span><dd>Only print the version. This is the default.
<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
</dl>
<div class="node">
<p><hr>
<a name="ntpq-exit-status"></a>Previous: <a rel="previous" accesskey="p" href="#ntpq-config">ntpq config</a>,
Up: <a rel="up" accesskey="u" href="#ntpq-Invocation">ntpq Invocation</a>
<br>
</div>
<h4 class="subsection">ntpq exit status</h4>
<p>One of the following exit values will be returned:
<dl>
<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
<br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded.
<br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error. Please report
it to autogen-users@lists.sourceforge.net. Thank you.
</dl>
<div class="node">
<p><hr>
<a name="Usage"></a>Next: <a rel="next" accesskey="n" href="#Internal-Commands">Internal Commands</a>,
Previous: <a rel="previous" accesskey="p" href="#ntpq-Description">ntpq Description</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Usage</h3>
<p><table summary=""><tr align="left"><th valign="top" width="23%">What </th><th valign="top" width="23%">Default </th><th valign="top" width="5%">Flag </th><th valign="top" width="15%">Option
<br></th></tr><tr align="left"><td valign="top" width="23%">configuration file
</td><td valign="top" width="23%"><code>/etc/ntp.conf</code>
</td><td valign="top" width="5%"><code>-c</code>
</td><td valign="top" width="15%"><code>conffile</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">frequency file
</td><td valign="top" width="23%">none
</td><td valign="top" width="5%"><code>-f</code>
</td><td valign="top" width="15%"><code>driftfile</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">leapseconds file
</td><td valign="top" width="23%">none
</td><td valign="top" width="5%">
</td><td valign="top" width="15%"><code>leapfile</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">process ID file
</td><td valign="top" width="23%">none
</td><td valign="top" width="5%"><code>-p</code>
</td><td valign="top" width="15%"><code>pidfile</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">log file
</td><td valign="top" width="23%">system log
</td><td valign="top" width="5%"><code>-l</code>
</td><td valign="top" width="15%"><code>logfile</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">include file
</td><td valign="top" width="23%">none
</td><td valign="top" width="5%">none
</td><td valign="top" width="15%"><code>includefile</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">statistics path
</td><td valign="top" width="23%"><code>/var/NTP</code>
</td><td valign="top" width="5%"><code>-s</code>
</td><td valign="top" width="15%"><code>statsdir</code>
<br></td></tr><tr align="left"><td valign="top" width="23%">keys path
</td><td valign="top" width="23%"><code>/usr/local/etc</code>
</td><td valign="top" width="5%"><code>-k</code>
</td><td valign="top" width="15%"><code>keysdir</code>
<br></td></tr></table>
<div class="node">
<p><hr>
<a name="Internal-Commands"></a>Next: <a rel="next" accesskey="n" href="#Control-Message-Commands">Control Message Commands</a>,
Previous: <a rel="previous" accesskey="p" href="#Usage">Usage</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Internal Commands</h3>
<p>Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <code>></code>, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the <code>ntpq</code> program itself and do not result in NTP mode-6 requests being sent to a server. These are described following.
<dl>
<dt><code><a name="help"></a> ? [</code><kbd>command_keyword</kbd><code>]</code><dt><code>help [</code><kbd>command_keyword</kbd><code>]</code><dd>A <code>?</code> by itself will print a list of all the command keywords known to <code>ntpq</code>. A <code>?</code> followed by a command keyword will print function and usage information about the command.
<br><dt><code><a name="addvars"></a> >addvars </code><kbd>name</kbd><code> [ = </code><kbd>value</kbd><code>] [...]</code><dt><code>rmvars </code><kbd>name</kbd><code> [...]</code><dt><code>clearvars</dt></code><dd>The arguments to these commands consist of a list of items of the form
<kbd>name</kbd><code> = </code><kbd>value</kbd>, where the <code>= </code><kbd>value</kbd> is ignored,
and can be omitted in read requests.
<code>ntpq</code> maintains an internal list in which data to be included
in control messages can be assembled, and sent using the <code>readlist</code>
and <code>writelist</code> commands described below.
The <code>addvars</code> command allows variables and optional values
to be added to the list.
If more than one variable is to be added
the list should be comma-separated and not contain white space.
The <code>rmvars</code> command can be used to remove individual variables
from the list,
while the <code>clearlist</code> command removes all variables from the list.
<br><dt><code><a name="cooked"></a> cooked</code><dd>Display server messages in prettyprint format.
<br><dt><code><a name="debug"></a> debug more | less | off</code><dd>Turns internal query program debugging on and off.
<br><dt><code><a name="delay"></a> delay </code><kbd>milliseconds</kbd><dd>Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete.
<br><dt><code><a name="host"></a> host </code><kbd>name</kbd><dd>Set the host to which future queries will be sent.
The name may be either a DNS name or a numeric address.
<br><dt><code><a name="hostnames"></a> hostnames [yes | no]</code><dd>If <code>yes</code> is specified, host names are printed in information displays.
If <code>no</code> is specified, numeric addresses are printed instead.
The default is <code>yes</code>,
unless modified using the command line <code>-n</code> switch.
<br><dt><code><a name="keyid"></a> keyid </code><kbd>keyid</kbd><dd>This command specifies the key number to be used
to authenticate configuration requests.
This must correspond to a key ID configured in <code>ntp.conf</code> for this purpose.
<br><dt><code><a name="keytype"></a> keytype</code><dd>Specify the digest algorithm to use for authenticated requests,
with default <code>MD5</code>.
If the OpenSSL library is installed,
digest can be be any message digest algorithm supported by the library.
The current selections are: <code>MD2</code>, <code>MD4</code>, <code>MD5</code>, <code>MDC2</code>, <code>RIPEMD160</code>, <code>SHA</code> and <code>SHA1</code>.
<br><dt><code><a name="ntpversion"></a> ntpversion 1 | 2 | 3 | 4</code><dd>Sets the NTP version number which <code>ntpq</code> claims in packets.
Defaults to 2.
Note that mode-6 control messages (and modes, for that matter)
didn't exist in NTP version 1.
<br><dt><code><a name="passwd"></a> passwd</code><dd>This command prompts for a password to authenticate requests.
The password must correspond to the key ID configured in <code>ntp.conf</code> for this purpose.
<br><dt><code><a name="quit"></a> quit</code><dd>Exit <code>ntpq</code>.
<br><dt><code><a name="raw"></a> raw</code><dd>Display server messages as received and without reformatting.
<br><dt><code><a name="timeout"></a> timeout </code><kbd>millseconds</kbd><dd>Specify a timeout period for responses to server queries.
The default is about 5000 milliseconds.
Note that since <code>ntpq</code> retries each query once after a timeout
the total waiting time for a timeout will be twice the timeout value set.
</dl>
<div class="node">
<p><hr>
<a name="Control-Message-Commands"></a>Next: <a rel="next" accesskey="n" href="#Status-Words-and-Kiss-Codes">Status Words and Kiss Codes</a>,
Previous: <a rel="previous" accesskey="p" href="#Internal-Commands">Internal Commands</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Control Message Commands</h3>
<p>Association IDs are used to identify system, peer and clock variables.
System variables are assigned an association ID of zero and system name space,
while each association is assigned a nonzero association ID and peer namespace.
Most control commands send a single mode-6 message to the server
and expect a single response message.
The exceptions are the <code>peers</code> command,
which sends a series of messages,
and the <code>mreadlist</code> and <code>mreadvar</code> commands,
which iterate over a range of associations.
<p><a name="as"></a>
<dl>
<dt><code>associations</code><dd>Display a list of mobilized associations in the form:
<br>
<code>ind assid status conf reach auth condition last_event cnt</code>
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="40%">Description
<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>ind</code>
</td><td valign="top" width="40%">index on this list
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>assid</code>
</td><td valign="top" width="40%">association ID
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
</td><td valign="top" width="40%"><a href="decode.html#peer">peer status word</a>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>conf</code>
</td><td valign="top" width="40%"><code>yes</code>: persistent, <code>no</code>: ephemeral
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reach</code>
</td><td valign="top" width="40%"><code>yes</code>: reachable, <code>no</code>: unreachable
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>auth</code>
</td><td valign="top" width="40%"><code>ok</code>, <code>yes</code>, <code>bad</code> and <code>none</code>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>condition</code>
</td><td valign="top" width="40%">selection status (see the <code>select</code> field of the <a href="decode.html#peer">peer status word</a>)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>last_event</code>
</td><td valign="top" width="40%">event report (see the <code>event</code> field of the <a href="decode.html#peer">peer status word</a>)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>cnt</code>
event count (see the <code>count</code> field of the <a href="decode.html#peer">peer status word</a>)
<br></td></tr></table>
<br><dt><code><a name="cv"></a> clockvar </code><kbd>assocID</kbd><code> [</code><kbd>name</kbd><code> [ = </code><kbd>value</kbd><code> [...]] [...]]</code><dt><code>cv </code><kbd>assocID</kbd><code> [</code><kbd>name</kbd><code> [ = </code><kbd>value</kbd><code> [...] ][...]]</code><dd>Display a list of <a href="#clock">clock variables</a> for those associations supporting a reference clock.
<br><dt><code><a name="_003aconfig"></a> :config [...]</code><dd>Send the remainder of the command line, including whitespace, to the server
as a run-time configuration command in the same format
as the configuration file.
This command is experimental until further notice and clarification.
Authentication is of course required.
<br><dt><code><a name="config_002dfrom_002dfile"></a> config-from-file </code><kbd>filename</kbd><dd>Send the each line of <kbd>filename</kbd> to the server as
run-time configuration commands in the same format as the configuration file.
This command is experimental until further notice and clarification.
Authentication is required.
<br><dt><code><a name="ifstats"></a> ifstats</code><dd>Display statistics for each local network address.
Authentication is required.
<br><dt><code><a name="iostats"></a> iostats</code><dd>Display network and reference clock I/O statistics.
<br><dt><code><a name="kerninfo"></a> kerninfo</code><dd>Display kernel loop and PPS statistics.
As with other ntpq output, times are in milliseconds.
The precision value displayed is in milliseconds as well,
unlike the precision system variable.
<br><dt><code><a name="lassoc"></a> lassociations</code><dd>Perform the same function as the associations command,
except display mobilized and unmobilized associations.
<br><dt><code><a name="monstats"></a> monstats</code><dd>Display monitor facility statistics.
<br><dt><code><a name="mrulist"></a> mrulist [limited | kod | mincount=</code><kbd>count</kbd><code> | laddr=</code><kbd>localaddr</kbd><code> | sort=</code><kbd>sortorder</kbd><code> | resany=</code><kbd>hexmask</kbd><code> | resall=</code><kbd>hexmask</kbd><code>]</code><dd>Obtain and print traffic counts collected and maintained by
the monitor facility.
With the exception of <code>sort=</code><kbd>sortorder</kbd>,
the options filter the list returned by <code>ntpd</code>.
The <code>limited</code> and <code>kod</code> options return only entries
representing client addresses from which the last packet received
triggered either discarding or a KoD response.
The <code>mincount=</code><kbd>count</kbd> option filters entries representing
less than <kbd>count</kbd> packets.
The <code>laddr=</code><kbd>localaddr</kbd> option filters entries for packets
received on any local address other than <kbd>localaddr</kbd>.
<code>resany=</code><kbd>hexmask</kbd> and <code>resall=</code><kbd>hexmask</kbd>
filter entries containing none or less than all, respectively,
of the bits in <kbd>hexmask</kbd>, which must begin with <code>0x</code>.
<br>
The <kbd>sortorder</kbd> defaults to <code>lstint</code> and may be any of
<code>addr</code>, <code>count</code>, <code>avgint</code>, <code>lstint</code>, or
any of those preceded by a minus sign (hyphen) to reverse the sort order.
The output columns are:
<p><table summary=""><tr align="left"><th valign="top" width="10%">Column </th><th valign="top" width="40%">Description
<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>lstint</code>
</td><td valign="top" width="40%">
Interval in s between the receipt of the most recent packet from this
address and the completion of the retrieval of the MRU list by <code>ntpq</code>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>avgint</code>
</td><td valign="top" width="40%">
Average interval in s between packets from this address.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rstr</code>
</td><td valign="top" width="40%">
Restriction flags associated with this address.
Most are copied unchanged from the matching <code>restrict</code> command,
however 0x400 (kod) and 0x20 (limited) flags are cleared unless
the last packet from this address triggered a rate control response.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>r</code>
</td><td valign="top" width="40%">
Rate control indicator, either a period, <code>L</code> or <code>K</code> for
no rate control response, rate limiting by discarding, or
rate limiting with a KoD response, respectively.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>m</code>
</td><td valign="top" width="40%">
Packet mode.
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>v</code>
</td><td valign="top" width="40%">
Packet version number.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>count</code>
</td><td valign="top" width="40%">
Packets received from this address.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rport</code>
</td><td valign="top" width="40%">
Source port of last packet from this address.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>remote address</code>
</td><td valign="top" width="40%">
DNS name, numeric address, or address followed by claimed DNS name which
could not be verified in parentheses.
<br></td></tr></table>
<br><dt><code><a name="mreadvar"></a> mreadvar </code><kbd>assocID</kbd> <kbd>assocID</kbd><code> [ </code><kbd>variable_name</kbd><code> [ = </code><kbd>value</kbd><code>[ ... ]</code><dt><code><a name="mrv"></a> mrv </code><kbd>assocID</kbd> <kbd>assocID</kbd><code> [ </code><kbd>variable_name</kbd><code> [ = </code><kbd>value</kbd><code>[ ... ]</code><dd>Perform the same function as the <code>readvar</code> command,
except for a range of association IDs.
This range is determined from the association list cached by
the most recent <code>associations</code> command.
<br><dt><code><a name="passoc"></a> passociations</code><dd>Perform the same function as the <code>associations command</code>, except that
it uses previously stored data rather than making a new query.
<br><dt><code><a name="pe"></a> peers</code><dd>Display a list of peers in the form:
<br>
<code>[tally]remote refid st t when pool reach delay offset jitter</code>
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
<br></th></tr><tr align="left"><td valign="top" width="10%"><code>[tally]</code>
</td><td valign="top" width="20%">
single-character code indicating current value of the <code>select</code> field
of the <a href="decode.html#peer">peer status word</a>.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>remote</code>
</td><td valign="top" width="20%">
host name (or IP number) of peer
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
</td><td valign="top" width="20%">
association ID or <a href="decode.html#kiss">kiss code</a>.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>st</code>
</td><td valign="top" width="20%">
stratum
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>t</code>
</td><td valign="top" width="20%">
<code>u</code>: unicast or manycast client,
<code>b</code>: broadcast or multicast client,
<code>l</code>: local (reference clock),
<code>s</code>: symmetric (peer),
<code>A</code>: manycast server,
<code>B</code>: broadcast server,
<code>M</code>: multicast server.
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>when</code>
</td><td valign="top" width="20%">
sec/min/hr since last received packet
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>poll</code>
</td><td valign="top" width="20%">
poll interval (log(2) s)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reach</code>
</td><td valign="top" width="20%">
reach shift register (octal)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>delay</code>
</td><td valign="top" width="20%">
roundtrip delay
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>offset</code>
</td><td valign="top" width="20%">
offset of server relative to this host
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>jitter</code>
</td><td valign="top" width="20%">
jitter
<br></td></tr></table>
<br><dt><code><a name="rv"></a> readvar </code><kbd>assocID</kbd> <kbd>name</kbd><code> [ = </code><kbd>value</kbd><code> ] [,...]</code><dt><code>rv </code><kbd>assocID</kbd><code> [ </code><kbd>name</kbd><code> ] [,...]</code><dd>Display the specified variables.
If <kbd>assocID</kbd> is zero,
the variables are from the <a href="#system">system variables</a> name space,
otherwise they are from the <a href="#peer">peer variables</a> name space.
The <kbd>assocID</kbd> is required, as the same name can occur in both spaces.
If no <kbd>name</kbd> is included,
all operative variables in the name space are displayed.
In this case only, if the <kbd>assocID</kbd> is omitted, it is assumed zero.
Multiple names are specified with comma separators and without whitespace.
Note that time values are represented in milliseconds and
frequency values in parts-per-million (PPM).
Some NTP timestamps are represented in the format YYYYMMDDTTTT,
where YYYY is the year, MM the month of year, DD the day of month and
TTTT the time of day.
<br><dt><code><a name="saveconfig"></a> saveconfig </code><kbd>filename</kbd><dd>Write the current configuration, including any runtime modifications
given with <code>:config</code> or <code>config-from-file</code>,
to the ntpd host's file <kbd>filename</kbd>.
This command will be rejected by the server unless
<a href="miscopt.html#saveconfigdir">saveconfigdir</a>
appears in the <code>ntpd</code> configuration file.
<kbd>filename</kbd> can use <code>strftime()</code> format specifiers
to substitute the current date and time, for example,
<code>saveconfig ntp-%Y%m%d-%H%M%S.conf</code>.
The filename used is stored in system variable <code>savedconfig</code>.
Authentication is required.
<br><dt><code><a name="writevar"></a> writevar </code><kbd>assocID</kbd> <kbd>name</kbd><code> = </code><kbd>value</kbd><code> [,...]</code><dd>Write the specified variables.
If the <kbd>assocID</kbd> is zero, the variables are from the
<a href="#system">system variables</a> name space, otherwise they are from the
<a href="#peer">peer variables</a> name space.
The <kbd>assocID</kbd> is required,
as the same name can occur in both spaces.
<br><dt><code><a name="sysinfo"></a> sysinfo</code><dd>Display operational summary.
<br><dt><code><a name="sysstats"></a> sysstats</code><dd>Print statistics counters maintained in the protocol module.
</dl>
<div class="node">
<p><hr>
<a name="Status-Words-and-Kiss-Codes"></a>Next: <a rel="next" accesskey="n" href="#System-Variables">System Variables</a>,
Previous: <a rel="previous" accesskey="p" href="#Control-Message-Commands">Control Message Commands</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Status Words and Kiss Codes</h3>
<p>The current state of the operating program is shown
in a set of status words maintained by the system
and each association separately.
These words are displayed in the <code>rv</code> and <code>as</code> commands
both in hexadecimal and decoded short tip strings.
The codes, tips and short explanations are on the
<a href="decode.html">Event Messages and Status Words</a> page.
The page also includes a list of system and peer messages,
the code for the latest of which is included in the status word.
<p>Information resulting from protocol machine state transitions
is displayed using an informal set of ASCII strings called
<a href="decode.html#kiss">kiss codes</a>.
The original purpose was for kiss-o'-death (KoD) packets sent
by the server to advise the client of an unusual condition.
They are now displayed, when appropriate,
in the reference identifier field in various billboards.
<div class="node">
<p><hr>
<a name="System-Variables"></a>Next: <a rel="next" accesskey="n" href="#Peer-Variables">Peer Variables</a>,
Previous: <a rel="previous" accesskey="p" href="#Status-Words-and-Kiss-Codes">Status Words and Kiss Codes</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">System Variables</h3>
<p>The following system variables appear in the <code>rv</code> billboard.
Not all variables are displayed in some configurations.
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
</td><td valign="top" width="20%">
<a href="decode.html#sys">system status word</a>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>version</code>
</td><td valign="top" width="20%">
NTP software version and build time
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>processor</code>
</td><td valign="top" width="20%">
hardware platform and version
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>system</code>
</td><td valign="top" width="20%">
operating system and version
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>leap</code>
</td><td valign="top" width="20%">
leap warning indicator (0-3)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>stratum</code>
</td><td valign="top" width="20%">
stratum (1-15)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>precision</code>
</td><td valign="top" width="20%">
precision (log(2) s)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdelay</code>
</td><td valign="top" width="20%">
total roundtrip delay to the primary reference clock
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdisp</code>
</td><td valign="top" width="20%">
total dispersion to the primary reference clock
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>peer</code>
</td><td valign="top" width="20%">
system peer association ID
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>tc</code>
time constant and poll exponent (log(2) s) (3-17)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>mintc</code>
minimum time constant (log(2) s) (3-10)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>clock</code>
</td><td valign="top" width="20%">
date and time of day
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
reference ID or <a href="decode.html#kiss">kiss code</a>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reftime</code>
</td><td valign="top" width="20%">
reference time
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>offset</code>
</td><td valign="top" width="20%">
combined offset of server relative to this host
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>sys_jitter</code>
</td><td valign="top" width="20%">
combined system jitter
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>frequency</code>
</td><td valign="top" width="20%">
frequency offset (PPM) relative to hardware clock
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>clk_wander</code>
</td><td valign="top" width="20%">
clock frequency wander (PPM)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>clk_jitter</code>
</td><td valign="top" width="20%">
clock jitter
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>tai</code>
</td><td valign="top" width="20%">
TAI-UTC offset (s)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>leapsec</code>
</td><td valign="top" width="20%">
NTP seconds when the next leap second is/was inserted
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>expire</code>
</td><td valign="top" width="20%">
NTP seconds when the NIST leapseconds file expires
<br></td></tr></table>
<p>The jitter and wander statistics are exponentially-weighted RMS averages.
The system jitter is defined in the NTPv4 specification;
the clock jitter statistic is computed by the clock discipline module.
<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
additional system variables are displayed, including some or all of the
following, depending on the particular Autokey dance:
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>host</code>
</td><td valign="top" width="20%">
Autokey host name for this host
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>ident</code>
</td><td valign="top" width="20%">
Autokey group name for this host
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
</td><td valign="top" width="20%">
host flags (see Autokey specification)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>digest</code>
</td><td valign="top" width="20%">
OpenSSL message digest algorithm
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>signature</code>
</td><td valign="top" width="20%">
OpenSSL digest/signature scheme
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>update</code>
</td><td valign="top" width="20%">
NTP seconds at last signature update
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>cert</code>
</td><td valign="top" width="20%">
certificate subject, issuer and certificate flags
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>until</code>
</td><td valign="top" width="20%">
NTP seconds when the certificate expires
<br></td></tr></table>
<div class="node">
<p><hr>
<a name="Peer-Variables"></a>Next: <a rel="next" accesskey="n" href="#Clock-Variables">Clock Variables</a>,
Previous: <a rel="previous" accesskey="p" href="#System-Variables">System Variables</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Peer Variables</h3>
<p>The following peer variables appear in the <code>rv</code> billboard
for each association.
Not all variables are displayed in some configurations.
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>associd</code>
</td><td valign="top" width="20%">
association ID
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
</td><td valign="top" width="20%">
<a href="decode.html#peer">peer status word</a>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>srcadr</code>
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>srcport</code>
</td><td valign="top" width="20%">
source (remote) IP address and port
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>dstadr</code>
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>dstport</code>
</td><td valign="top" width="20%">
destination (local) IP address and port
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>leap</code>
</td><td valign="top" width="20%">
leap indicator (0-3)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>stratum</code>
</td><td valign="top" width="20%">
stratum (0-15)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>precision</code>
</td><td valign="top" width="20%">
precision (log(2) s)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdelay</code>
</td><td valign="top" width="20%">
total roundtrip delay to the primary reference clock
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>rootdisp</code>
</td><td valign="top" width="20%">total root dispersion to the primary reference clock
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
</td><td valign="top" width="20%">
reference ID or <a href="decode.html#kiss">kiss code</a>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reftime</code>
</td><td valign="top" width="20%">
reference time
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>reach</code>
</td><td valign="top" width="20%">
reach register (octal)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>unreach</code>
</td><td valign="top" width="20%">
unreach counter
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>hmode</code>
</td><td valign="top" width="20%">
host mode (1-6)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>pmode</code>
</td><td valign="top" width="20%">
peer mode (1-5)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>hpoll</code>
</td><td valign="top" width="20%">
host poll exponent (log(2) s) (3-17)
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>ppoll</code>
</td><td valign="top" width="20%">
peer poll exponent (log(2) s) (3-17)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>headway</code>
</td><td valign="top" width="20%">
headway (see <a href="rate.html">Rate Management and the Kiss-o'-Death Packet</a>)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>flash</code>
</td><td valign="top" width="20%">
<a href="decode.html#flash">flash status word</a>
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>offset</code>
</td><td valign="top" width="20%">
filter offset
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>delay</code>
</td><td valign="top" width="20%">
filter delay
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>dispersion</code>
</td><td valign="top" width="20%">
filter dispersion
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>jitter</code>
</td><td valign="top" width="20%">
filter jitter
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>ident</code>
</td><td valign="top" width="20%">
Autokey group name for this association
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>bias</code>
</td><td valign="top" width="20%">
unicast/broadcast bias
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>xleave</code>
</td><td valign="top" width="20%">
interleave delay (see <a href="xleave.html">NTP Interleaved Modes</a>)
<br></td></tr></table>
<p>The bias variable is calculated when the first broadcast packet is received
after the calibration volley. It represents the offset of the broadcast
subgraph relative to the unicast subgraph. The xleave variable appears
only the interleaved symmetric and interleaved modes. It represents
the internal queuing, buffering and transmission delays for the preceding
packet.
<p>When the NTPv4 daemon is compiled with the OpenSSL software library,
additional peer variables are displayed, including the following:
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
<p><br></th></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
</td><td valign="top" width="20%">
peer flags (see Autokey specification)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>host</code>
</td><td valign="top" width="20%">
Autokey server name
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
</td><td valign="top" width="20%">
peer flags (see Autokey specification)
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>signature</code>
</td><td valign="top" width="20%">
OpenSSL digest/signature scheme
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>initsequence</code>
</td><td valign="top" width="20%">
initial key ID
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>initkey</code>
</td><td valign="top" width="20%">
initial key index
<p><br></td></tr><tr align="left"><td valign="top" width="10%"><code>timestamp</code>
</td><td valign="top" width="20%">
Autokey signature timestamp
<br></td></tr></table>
<div class="node">
<p><hr>
<a name="Clock-Variables"></a>Previous: <a rel="previous" accesskey="p" href="#Peer-Variables">Peer Variables</a>,
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">Clock Variables</h3>
<p>The following clock variables appear in the <code>cv</code> billboard for each association with a reference clock. Not all variables are displayed in some configurations.
<p><table summary=""><tr align="left"><th valign="top" width="10%">Variable </th><th valign="top" width="20%">Description
<br></th></tr><tr align="left"><td valign="top" width="10%"><code>associd</code>
</td><td valign="top" width="20%">association ID
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>status</code>
</td><td valign="top" width="20%"><a href="decode.html#clock">clock status word</a>
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>device</code>
</td><td valign="top" width="20%">device description
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>timecode</code>
</td><td valign="top" width="20%">ASCII time code string (specific to device)
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>poll</code>
</td><td valign="top" width="20%">poll messages sent
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>noreply</code>
</td><td valign="top" width="20%">no reply
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>badformat</code>
</td><td valign="top" width="20%">bad format
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>baddata</code>
</td><td valign="top" width="20%">bad date or time
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>fudgetime1</code>
</td><td valign="top" width="20%">fudge time 1
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>fudgetime2</code>
</td><td valign="top" width="20%">fudge time 2
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>stratum</code>
</td><td valign="top" width="20%">driver stratum
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>refid</code>
</td><td valign="top" width="20%">driver reference ID
<br></td></tr><tr align="left"><td valign="top" width="10%"><code>flags</code>
</td><td valign="top" width="20%">driver flags
<br></td></tr></table>
</body></html>
|