ntpq.1ntpqman revision 293650
1.de1 NOP 2. it 1 an-trap 3. if \\n[.$] \,\\$*\/ 4.. 5.ie t \ 6.ds B-Font [CB] 7.ds I-Font [CI] 8.ds R-Font [CR] 9.el \ 10.ds B-Font B 11.ds I-Font I 12.ds R-Font R 13.TH ntpq 1ntpqman "07 Jan 2016" "4.2.8p5" "User Commands" 14.\" 15.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-4VaaKt/ag-eWa4It) 16.\" 17.\" It has been AutoGen-ed January 7, 2016 at 11:31:55 PM by AutoGen 5.18.5 18.\" From the definitions ntpq-opts.def 19.\" and the template file agman-cmd.tpl 20.SH NAME 21\f\*[B-Font]ntpq\fP 22\- standard NTP query program 23.SH SYNOPSIS 24\f\*[B-Font]ntpq\fP 25.\" Mixture of short (flag) options and long options 26[\f\*[B-Font]\-flags\f[]] 27[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] 28[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] 29[ host ...] 30.sp \n(Ppu 31.ne 2 32 33.SH DESCRIPTION 34The 35\f\*[B-Font]ntpq\fP 36utility program is used to query NTP servers which 37implement the standard NTP mode 6 control message formats defined 38in Appendix B of the NTPv3 specification RFC1305, requesting 39information about current state and/or changes in that state. 40The same formats are used in NTPv4, although some of the 41variables have changed and new ones added. The description on this 42page is for the NTPv4 variables. 43The program may be run either in interactive mode or controlled using 44command line arguments. 45Requests to read and write arbitrary 46variables can be assembled, with raw and pretty-printed output 47options being available. 48The 49\f\*[B-Font]ntpq\fP 50utility can also obtain and print a 51list of peers in a common format by sending multiple queries to the 52server. 53If one or more request options is included on the command line 54when 55\f\*[B-Font]ntpq\fP 56is executed, each of the requests will be sent 57to the NTP servers running on each of the hosts given as command 58line arguments, or on localhost by default. 59If no request options 60are given, 61\f\*[B-Font]ntpq\fP 62will attempt to read commands from the 63standard input and execute these on the NTP server running on the 64first host given on the command line, again defaulting to localhost 65when no other host is specified. 66The 67\f\*[B-Font]ntpq\fP 68utility will prompt for 69commands if the standard input is a terminal device. 70\f\*[B-Font]ntpq\fP 71uses NTP mode 6 packets to communicate with the 72NTP server, and hence can be used to query any compatible server on 73the network which permits it. 74Note that since NTP is a UDP protocol 75this communication will be somewhat unreliable, especially over 76large distances in terms of network topology. 77The 78\f\*[B-Font]ntpq\fP 79utility makes 80one attempt to retransmit requests, and will time requests out if 81the remote host is not heard from within a suitable timeout 82time. 83Specifying a 84command line option other than 85\f\*[B-Font]\-i\f[] 86or 87\f\*[B-Font]\-n\f[] 88will 89cause the specified query (queries) to be sent to the indicated 90host(s) immediately. 91Otherwise, 92\f\*[B-Font]ntpq\fP 93will attempt to read 94interactive format commands from the standard input. 95.SS "Internal Commands" 96Interactive format commands consist of a keyword followed by zero 97to four arguments. 98Only enough characters of the full keyword to 99uniquely identify the command need be typed. 100A 101number of interactive format commands are executed entirely within 102the 103\f\*[B-Font]ntpq\fP 104utility itself and do not result in NTP mode 6 105requests being sent to a server. 106These are described following. 107.TP 20 108.NOP \f\*[B-Font]?\f[] [\f\*[I-Font]command_keyword\f[]] 109.br 110.ns 111.TP 20 112.NOP \f\*[B-Font]help\f[] [\f\*[I-Font]command_keyword\f[]] 113A 114\[oq]\&?\[cq] 115by itself will print a list of all the command 116keywords known to this incarnation of 117\f\*[B-Font]ntpq\fP. 118A 119\[oq]\&?\[cq] 120followed by a command keyword will print function and usage 121information about the command. 122This command is probably a better 123source of information about 124\f\*[B-Font]ntpq\fP 125than this manual 126page. 127.br 128.ns 129.TP 20 130.NOP \f\*[B-Font]addvars\f[] \f\*[I-Font]variable_name\f[][\f\*[B-Font]=value\f[]] \f\*[B-Font]...\f[] 131.br 132.ns 133.TP 20 134.NOP \f\*[B-Font]rmvars\f[] \f\*[I-Font]variable_name\f[] \f\*[B-Font]...\f[] 135.br 136.ns 137.TP 20 138.NOP \f\*[B-Font]clearvars\f[] 139.br 140.ns 141.TP 20 142.NOP \f\*[B-Font]showvars\f[] 143The data carried by NTP mode 6 messages consists of a list of 144items of the form 145\[oq]variable_name=value\[cq], 146where the 147\[oq]=value\[cq] 148is ignored, and can be omitted, 149in requests to the server to read variables. 150The 151\f\*[B-Font]ntpq\fP 152utility maintains an internal list in which data to be included in control 153messages can be assembled, and sent using the 154\f\*[B-Font]readlist\f[] 155and 156\f\*[B-Font]writelist\f[] 157commands described below. 158The 159\f\*[B-Font]addvars\f[] 160command allows variables and their optional values to be added to 161the list. 162If more than one variable is to be added, the list should 163be comma-separated and not contain white space. 164The 165\f\*[B-Font]rmvars\f[] 166command can be used to remove individual variables from the list, 167while the 168\f\*[B-Font]clearlist\f[] 169command removes all variables from the 170list. 171The 172\f\*[B-Font]showvars\f[] 173command displays the current list of optional variables. 174.br 175.ns 176.TP 20 177.NOP \f\*[B-Font]authenticate\f[] [yes | no] 178Normally 179\f\*[B-Font]ntpq\fP 180does not authenticate requests unless 181they are write requests. 182The command 183\[oq]authenticate yes\[cq] 184causes 185\f\*[B-Font]ntpq\fP 186to send authentication with all requests it 187makes. 188Authenticated requests causes some servers to handle 189requests slightly differently, and can occasionally melt the CPU in 190fuzzballs if you turn authentication on before doing a 191\f\*[B-Font]peer\f[] 192display. 193The command 194\[oq]authenticate\[cq] 195causes 196\f\*[B-Font]ntpq\fP 197to display whether or not 198\f\*[B-Font]ntpq\fP 199is currently autheinticating requests. 200.br 201.ns 202.TP 20 203.NOP \f\*[B-Font]cooked\f[] 204Causes output from query commands to be "cooked", so that 205variables which are recognized by 206\f\*[B-Font]ntpq\fP 207will have their 208values reformatted for human consumption. 209Variables which 210\f\*[B-Font]ntpq\fP 211thinks should have a decodable value but didn't are 212marked with a trailing 213\[oq]\&?\[cq]. 214.br 215.ns 216.TP 20 217.NOP \f\*[B-Font]debug\f[] [\f\*[B-Font]more\f[] | \f\*[B-Font]less\f[] | \f\*[B-Font]off\f[]] 218With no argument, displays the current debug level. 219Otherwise, the debug level is changed to the indicated level. 220.br 221.ns 222.TP 20 223.NOP \f\*[B-Font]delay\f[] \f\*[I-Font]milliseconds\f[] 224Specify a time interval to be added to timestamps included in 225requests which require authentication. 226This is used to enable 227(unreliable) server reconfiguration over long delay network paths 228or between machines whose clocks are unsynchronized. 229Actually the 230server does not now require timestamps in authenticated requests, 231so this command may be obsolete. 232.br 233.ns 234.TP 20 235.NOP \f\*[B-Font]exit\f[] 236Exit 237\f\*[B-Font]ntpq\fP. 238.br 239.ns 240.TP 20 241.NOP \f\*[B-Font]host\f[] \f\*[I-Font]hostname\f[] 242Set the host to which future queries will be sent. 243\f\*[I-Font]hostname\f[] 244may be either a host name or a numeric address. 245.br 246.ns 247.TP 20 248.NOP \f\*[B-Font]hostnames\f[] [\f\*[B-Font]yes\f[] | \f\*[B-Font]no\f[]] 249If 250\f\*[B-Font]yes\f[] 251is specified, host names are printed in 252information displays. 253If 254\f\*[B-Font]no\f[] 255is specified, numeric 256addresses are printed instead. 257The default is 258\f\*[B-Font]yes\f[], 259unless 260modified using the command line 261\f\*[B-Font]\-n\f[] 262switch. 263.br 264.ns 265.TP 20 266.NOP \f\*[B-Font]keyid\f[] \f\*[I-Font]keyid\f[] 267This command allows the specification of a key number to be 268used to authenticate configuration requests. 269This must correspond 270to the 271\f\*[B-Font]controlkey\f[] 272key number the server has been configured to use for this 273purpose. 274.br 275.ns 276.TP 20 277.NOP \f\*[B-Font]keytype\f[] [\f\*[B-Font]md5\f[] | \f\*[B-Font]OpenSSLDigestType\f[]] 278Specify the type of key to use for authenticating requests. 279\f\*[B-Font]md5\f[] 280is alway supported. 281If 282\f\*[B-Font]ntpq\fP 283was built with OpenSSL support, 284any digest type supported by OpenSSL can also be provided. 285If no argument is given, the current 286\f\*[B-Font]keytype\f[] 287is displayed. 288.br 289.ns 290.TP 20 291.NOP \f\*[B-Font]ntpversion\f[] [\f\*[B-Font]1\f[] | \f\*[B-Font]2\f[] | \f\*[B-Font]3\f[] | \f\*[B-Font]4\f[]] 292Sets the NTP version number which 293\f\*[B-Font]ntpq\fP 294claims in 295packets. 296Defaults to 3, and note that mode 6 control messages (and 297modes, for that matter) didn't exist in NTP version 1. 298There appear 299to be no servers left which demand version 1. 300With no argument, displays the current NTP version that will be used 301when communicating with servers. 302.br 303.ns 304.TP 20 305.NOP \f\*[B-Font]passwd\f[] 306This command prompts you to type in a password (which will not 307be echoed) which will be used to authenticate configuration 308requests. 309The password must correspond to the key configured for 310use by the NTP server for this purpose if such requests are to be 311successful. 312.\" Not yet implemented. 313.\" .It Ic poll 314.\" .Op Ar n 315.\" .Op Ic verbose 316.\" Poll an NTP server in client mode 317.\" .Ar n 318.\" times. 319.br 320.ns 321.TP 20 322.NOP \f\*[B-Font]quit\f[] 323Exit 324\f\*[B-Font]ntpq\fP. 325.br 326.ns 327.TP 20 328.NOP \f\*[B-Font]raw\f[] 329Causes all output from query commands is printed as received 330from the remote server. 331The only formating/interpretation done on 332the data is to transform nonascii data into a printable (but barely 333understandable) form. 334.br 335.ns 336.TP 20 337.NOP \f\*[B-Font]timeout\f[] \f\*[I-Font]milliseconds\f[] 338Specify a timeout period for responses to server queries. 339The 340default is about 5000 milliseconds. 341Note that since 342\f\*[B-Font]ntpq\fP 343retries each query once after a timeout, the total waiting time for 344a timeout will be twice the timeout value set. 345.br 346.ns 347.TP 20 348.NOP \f\*[B-Font]version\f[] 349Print the version of the 350\f\*[B-Font]ntpq\fP 351program. 352.PP 353.SS "Control Message Commands" 354Association IDs are used to identify system, peer and clock variables. 355System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace. 356Most control commands send a single mode-6 message to the server and expect a single response message. 357The exceptions are the 358\f[C]peers\f[] 359command, which sends a series of messages, 360and the 361\f[C]mreadlist\f[] 362and 363\f[C]mreadvar\f[] 364commands, which iterate over a range of associations. 365.TP 10 366.NOP \f\*[B-Font]associations\f[] 367Display a list of mobilized associations in the form: 368.Dl ind assid status conf reach auth condition last_event cnt 369.RS 370.IP \fB\(bu\fP 2 371.IP \fB\(bu\fP 2 \f[C]ind\f[] \f[C]Ta\f[] \f[C]index\f[] \f[C]on\f[] \f[C]this\f[] \f[C]list\f[] 372.IP \fB\(bu\fP 2 \f[C]assid\f[] \f[C]Ta\f[] \f[C]association\f[] \f[C]ID\f[] 373.IP \fB\(bu\fP 2 \f[C]status\f[] \f[C]Ta\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word\f[] 374.IP \fB\(bu\fP 2 \f[C]conf\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]persistent,\f[] \f[C]no\f[]: \f[C]ephemeral\f[] 375.IP \fB\(bu\fP 2 \f[C]reach\f[] \f[C]Ta\f[] \f[C]yes\f[]: \f[C]reachable,\f[] \f[C]no\f[]: \f[C]unreachable\f[] 376.IP \fB\(bu\fP 2 \f[C]auth\f[] \f[C]Ta\f[] \f[C]ok\f[], \f[C]yes\f[], \f[C]bad\f[] \f[C]and\f[] \f[C]none\f[] 377.IP \fB\(bu\fP 2 \f[C]condition\f[] \f[C]Ta\f[] \f[C]selection\f[] \f[C]status\f[] \f[C](see\f[] \f[C]the\f[] \f[C]select\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[] 378.IP \fB\(bu\fP 2 \f[C]last_event\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]report\f[] \f[C](see\f[] \f[C]the\f[] \f[C]event\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[] 379.IP \fB\(bu\fP 2 \f[C]cnt\f[] \f[C]Ta\f[] \f[C]event\f[] \f[C]count\f[] \f[C](see\f[] \f[C]the\f[] \f[C]count\f[] \f[C]field\f[] \f[C]of\f[] \f[C]the\f[] \f[C]peer\f[] \f[C]status\f[] \f[C]word)\f[] 380.RE 381.br 382.ns 383.TP 10 384.NOP \f\*[B-Font]authinfo\f[] 385Display the authentication statistics. 386.br 387.ns 388.TP 10 389.NOP \f\*[B-Font]clockvar\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...] 390.br 391.ns 392.TP 10 393.NOP \f\*[B-Font]cv\f[] \f\*[I-Font]assocID\f[] [\f\*[I-Font]name\f[][\f\*[B-Font]=\f[]\f\*[I-Font]value\f[]] [] ...] 394Display a list of clock variables for those associations supporting a reference clock. 395.br 396.ns 397.TP 10 398.NOP \f\*[B-Font]:config\f[] [...] 399Send 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. 400.br 401.ns 402.TP 10 403.NOP \f\*[B-Font]config-from-file\f[] \f\*[I-Font]filename\f[] 404Send the each line of 405\f\*[I-Font]filename\f[] 406to 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. 407.br 408.ns 409.TP 10 410.NOP \f\*[B-Font]ifstats\f[] 411Display statistics for each local network address. Authentication is required. 412.br 413.ns 414.TP 10 415.NOP \f\*[B-Font]iostats\f[] 416Display network and reference clock I/O statistics. 417.br 418.ns 419.TP 10 420.NOP \f\*[B-Font]kerninfo\f[] 421Display 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. 422.br 423.ns 424.TP 10 425.NOP \f\*[B-Font]lassociations\f[] 426Perform the same function as the associations command, except display mobilized and unmobilized associations. 427.br 428.ns 429.TP 10 430.NOP \f\*[B-Font]lopeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]] 431Obtain and print a list of all peers and clients showing 432\f\*[I-Font]dstadr\f[] 433(associated with any given IP version). 434.br 435.ns 436.TP 10 437.NOP \f\*[B-Font]lpeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]] 438Print a peer spreadsheet for the appropriate IP version(s). 439\f\*[I-Font]dstadr\f[] 440(associated with any given IP version). 441.br 442.ns 443.TP 10 444.NOP \f\*[B-Font]monstats\f[] 445Display monitor facility statistics. 446.br 447.ns 448.TP 10 449.NOP \f\*[B-Font]mrulist\f[] [\f\*[B-Font]limited\f[] | \f\*[B-Font]kod\f[] | \f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[] | \f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[] | \f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[] | \f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[] | \f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[]] 450Obtain and print traffic counts collected and maintained by the monitor facility. 451With the exception of 452\f\*[B-Font]sort\f[]=\f\*[I-Font]sortorder\f[], 453the options filter the list returned by 454\f\*[B-Font]ntpd.\f[] 455The 456\f\*[B-Font]limited\f[] 457and 458\f\*[B-Font]kod\f[] 459options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response. 460The 461\f\*[B-Font]mincount\f[]=\f\*[I-Font]count\f[] 462option filters entries representing less than 463\f\*[I-Font]count\f[] 464packets. 465The 466\f\*[B-Font]laddr\f[]=\f\*[I-Font]localaddr\f[] 467option filters entries for packets received on any local address other than 468\f\*[I-Font]localaddr\f[]. 469\f\*[B-Font]resany\f[]=\f\*[I-Font]hexmask\f[] 470and 471\f\*[B-Font]resall\f[]=\f\*[I-Font]hexmask\f[] 472filter entries containing none or less than all, respectively, of the bits in 473\f\*[I-Font]hexmask\f[], 474which must begin with 475\f\*[B-Font]0x\f[]. 476The 477\f\*[I-Font]sortorder\f[] 478defaults to 479\f\*[B-Font]lstint\f[] 480and may be any of 481\f\*[B-Font]addr\f[], 482\f\*[B-Font]count\f[], 483\f\*[B-Font]avgint\f[], 484\f\*[B-Font]lstint\f[], 485or any of those preceded by a minus sign (hyphen) to reverse the sort order. 486The output columns are: 487.RS 488.TP 10 489.NOP Column 490Description 491.br 492.ns 493.TP 10 494.NOP \f\*[B-Font]lstint\f[] 495Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by 496\f\*[B-Font]ntpq\fP. 497.br 498.ns 499.TP 10 500.NOP \f\*[B-Font]avgint\f[] 501Average interval in s between packets from this address. 502.br 503.ns 504.TP 10 505.NOP \f\*[B-Font]rstr\f[] 506Restriction flags associated with this address. 507Most are copied unchanged from the matching 508\f\*[B-Font]restrict\f[] 509command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response. 510.br 511.ns 512.TP 10 513.NOP \f\*[B-Font]r\f[] 514Rate control indicator, either 515a period, 516\f\*[B-Font]L\f[] 517or 518\f\*[B-Font]K\f[] 519for no rate control response, 520rate limiting by discarding, or rate limiting with a KoD response, respectively. 521.br 522.ns 523.TP 10 524.NOP \f\*[B-Font]m\f[] 525Packet mode. 526.br 527.ns 528.TP 10 529.NOP \f\*[B-Font]v\f[] 530Packet version number. 531.br 532.ns 533.TP 10 534.NOP \f\*[B-Font]count\f[] 535Packets received from this address. 536.br 537.ns 538.TP 10 539.NOP \f\*[B-Font]rport\f[] 540Source port of last packet from this address. 541.br 542.ns 543.TP 10 544.NOP \f\*[B-Font]remote\f[] \f\*[B-Font]address\f[] 545DNS name, numeric address, or address followed by 546claimed DNS name which could not be verified in parentheses. 547.RE 548.br 549.ns 550.TP 10 551.NOP \f\*[B-Font]mreadvar\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ... 552.br 553.ns 554.TP 10 555.NOP \f\*[B-Font]mrv\f[] \f\*[B-Font]assocID\f[] \f\*[B-Font]assocID\f[] [\f\*[I-Font]variable_name\f[][=\f\*[I-Font]value\f[]]] ... 556Perform the same function as the 557\f\*[B-Font]readvar\f[] 558command, except for a range of association IDs. 559This range is determined from the association list cached by the most recent 560\f\*[B-Font]associations\f[] 561command. 562.br 563.ns 564.TP 10 565.NOP \f\*[B-Font]opeers\f[] [\f\*[B-Font]\-4\f[] | \f\*[B-Font]\-6\f[]] 566Obtain and print the old-style list of all peers and clients showing 567\f\*[I-Font]dstadr\f[] 568(associated with any given IP version), 569rather than the 570\f\*[I-Font]refid\f[]. 571.br 572.ns 573.TP 10 574.NOP \f\*[B-Font]passociations\f[] 575Perform the same function as the 576\f\*[B-Font]associations\f[] 577command, 578except that it uses previously stored data rather than making a new query. 579.br 580.ns 581.TP 10 582.NOP \f\*[B-Font]peers\f[] 583Display a list of peers in the form: 584.Dl [tally]remote refid st t when pool reach delay offset jitter 585.RS 586.TP 10 587.NOP Variable 588Description 589.br 590.ns 591.TP 10 592.NOP \f\*[B-Font][tally]\f[] 593single-character code indicating current value of the 594\f\*[B-Font]select\f[] 595field of the 596.Lk decode.html#peer "peer status word" 597.br 598.ns 599.TP 10 600.NOP \f\*[B-Font]remote\f[] 601host name (or IP number) of peer. 602The value displayed will be truncated to 15 characters unless the 603\f\*[B-Font]\-w\f[] 604flag is given, in which case the full value will be displayed 605on the first line, 606and the remaining data is displayed on the next line. 607.br 608.ns 609.TP 10 610.NOP \f\*[B-Font]refid\f[] 611association ID or 612.Lk decode.html#kiss "'kiss code" 613.br 614.ns 615.TP 10 616.NOP \f\*[B-Font]st\f[] 617stratum 618.br 619.ns 620.TP 10 621.NOP \f\*[B-Font]t\f[] 622\f\*[B-Font]u\f[]: 623unicast or manycast client, 624\f\*[B-Font]b\f[]: 625broadcast or multicast client, 626\f\*[B-Font]l\f[]: 627local (reference clock), 628\f\*[B-Font]s\f[]: 629symmetric (peer), 630\f\*[B-Font]A\f[]: 631manycast server, 632\f\*[B-Font]B\f[]: 633broadcast server, 634\f\*[B-Font]M\f[]: 635multicast server 636.br 637.ns 638.TP 10 639.NOP \f\*[B-Font]when\f[] 640sec/min/hr since last received packet 641.br 642.ns 643.TP 10 644.NOP \f\*[B-Font]poll\f[] 645poll interval (log2 s) 646.br 647.ns 648.TP 10 649.NOP \f\*[B-Font]reach\f[] 650reach shift register (octal) 651.br 652.ns 653.TP 10 654.NOP \f\*[B-Font]delay\f[] 655roundtrip delay 656.br 657.ns 658.TP 10 659.NOP \f\*[B-Font]offset\f[] 660offset of server relative to this host 661.br 662.ns 663.TP 10 664.NOP \f\*[B-Font]jitter\f[] 665jitter 666.RE 667.br 668.ns 669.TP 10 670.NOP \f\*[B-Font]apeers\f[] 671Display a list of peers in the form: 672.Dl [tally]remote refid assid st t when pool reach delay offset jitter 673where the output is just like the 674\f\*[B-Font]peers\f[] 675command except that the 676\f\*[B-Font]refid\f[] 677is displayed in hex format and the association number is also displayed. 678.br 679.ns 680.TP 10 681.NOP \f\*[B-Font]pstats\f[] \f\*[I-Font]assocID\f[] 682Show the statistics for the peer with the given 683\f\*[I-Font]assocID\f[]. 684.br 685.ns 686.TP 10 687.NOP \f\*[B-Font]readlist\f[] \f\*[I-Font]assocID\f[] 688.br 689.ns 690.TP 10 691.NOP \f\*[B-Font]rl\f[] \f\*[I-Font]assocID\f[] 692Read the system or peer variables included in the variable list. 693.br 694.ns 695.TP 10 696.NOP \f\*[B-Font]readvar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...] 697.br 698.ns 699.TP 10 700.NOP \f\*[B-Font]rv\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[][=\f\*[I-Font]value\f[]] [, ...] 701Display the specified variables. 702If 703\f\*[I-Font]assocID\f[] 704is zero, the variables are from the 705\fISystem\f[] \fIVariables\f[] 706name space, otherwise they are from the 707\fIPeer\f[] \fIVariables\f[] 708name space. 709The 710\f\*[I-Font]assocID\f[] 711is required, as the same name can occur in both spaces. 712If no 713\f\*[I-Font]name\f[] 714is included, all operative variables in the name space are displayed. 715In this case only, if the 716\f\*[I-Font]assocID\f[] 717is omitted, it is assumed zero. 718Multiple names are specified with comma separators and without whitespace. 719Note that time values are represented in milliseconds 720and frequency values in parts-per-million (PPM). 721Some NTP timestamps are represented in the format 722YYYYMMDDTTTT , 723where YYYY is the year, 724MM the month of year, 725DD the day of month and 726TTTT the time of day. 727.br 728.ns 729.TP 10 730.NOP \f\*[B-Font]reslist\f[] 731Show the access control (restrict) list for 732\f\*[B-Font]ntpq\fP. 733.br 734.ns 735.TP 10 736.NOP \f\*[B-Font]saveconfig\f[] \f\*[I-Font]filename\f[] 737Write the current configuration, 738including any runtime modifications given with 739\f\*[B-Font]:config\f[] 740or 741\f\*[B-Font]config-from-file\f[], 742to the ntpd host's file 743\f\*[I-Font]filename\f[]. 744This command will be rejected by the server unless 745.Lk miscopt.html#saveconfigdir "saveconfigdir" 746appears in the 747\f\*[B-Font]ntpd\f[] 748configuration file. 749\f\*[I-Font]filename\f[] 750can use 751\fCstrftime\f[]\fR()\f[] 752format specifies to substitute the current date and time, for example, 753\f\*[B-Font]q]saveconfig\f[] \f\*[B-Font]ntp-%Y%m%d-%H%M%S.confq]\f[]. 754The filename used is stored in system variable 755\f\*[B-Font]savedconfig\f[]. 756Authentication is required. 757.br 758.ns 759.TP 10 760.NOP \f\*[B-Font]timerstats\f[] 761Display interval timer counters. 762.br 763.ns 764.TP 10 765.NOP \f\*[B-Font]writelist\f[] \f\*[I-Font]assocID\f[] 766Write the system or peer variables included in the variable list. 767.br 768.ns 769.TP 10 770.NOP \f\*[B-Font]writevar\f[] \f\*[I-Font]assocID\f[] \f\*[I-Font]name\f[]=\f\*[I-Font]value\f[] [, ...] 771Write the specified variables. 772If the 773\f\*[I-Font]assocID\f[] 774is zero, the variables are from the 775\fISystem\f[] \fIVariables\f[] 776name space, otherwise they are from the 777\fIPeer\f[] \fIVariables\f[] 778name space. 779The 780\f\*[I-Font]assocID\f[] 781is required, as the same name can occur in both spaces. 782.br 783.ns 784.TP 10 785.NOP \f\*[B-Font]sysinfo\f[] 786Display operational summary. 787.br 788.ns 789.TP 10 790.NOP \f\*[B-Font]sysstats\f[] 791Print statistics counters maintained in the protocol module. 792.PP 793.SS Status Words and Kiss Codes 794The current state of the operating program is shown 795in a set of status words 796maintained by the system. 797Status information is also available on a per-association basis. 798These words are displayed in the 799\f\*[B-Font]rv\f[] 800and 801\f\*[B-Font]as\f[] 802commands both in hexadecimal and in decoded short tip strings. 803The codes, tips and short explanations are documented on the 804.Lk decode.html "Event Messages and Status Words" 805page. 806The page also includes a list of system and peer messages, 807the code for the latest of which is included in the status word. 808.sp \n(Ppu 809.ne 2 810 811Information resulting from protocol machine state transitions 812is displayed using an informal set of ASCII strings called 813.Lk decode.html#kiss "kiss codes" . 814The original purpose was for kiss-o'-death (KoD) packets 815sent by the server to advise the client of an unusual condition. 816They are now displayed, when appropriate, 817in the reference identifier field in various billboards. 818.SS System Variables 819The following system variables appear in the 820\f\*[B-Font]rv\f[] 821billboard. 822Not all variables are displayed in some configurations. 823.TP 10 824.NOP Variable 825Description 826.br 827.ns 828.TP 10 829.NOP \f\*[B-Font]status\f[] 830.Lk decode.html#sys "system status word" 831.br 832.ns 833.TP 10 834.NOP \f\*[B-Font]version\f[] 835NTP software version and build time 836.br 837.ns 838.TP 10 839.NOP \f\*[B-Font]processor\f[] 840hardware platform and version 841.br 842.ns 843.TP 10 844.NOP \f\*[B-Font]system\f[] 845operating system and version 846.br 847.ns 848.TP 10 849.NOP \f\*[B-Font]leap\f[] 850leap warning indicator (0-3) 851.br 852.ns 853.TP 10 854.NOP \f\*[B-Font]stratum\f[] 855stratum (1-15) 856.br 857.ns 858.TP 10 859.NOP \f\*[B-Font]precision\f[] 860precision (log2 s) 861.br 862.ns 863.TP 10 864.NOP \f\*[B-Font]rootdelay\f[] 865total roundtrip delay to the primary reference clock 866.br 867.ns 868.TP 10 869.NOP \f\*[B-Font]rootdisp\f[] 870total dispersion to the primary reference clock 871.br 872.ns 873.TP 10 874.NOP \f\*[B-Font]peer\f[] 875system peer association ID 876.br 877.ns 878.TP 10 879.NOP \f\*[B-Font]tc\f[] 880time constant and poll exponent (log2 s) (3-17) 881.br 882.ns 883.TP 10 884.NOP \f\*[B-Font]mintc\f[] 885minimum time constant (log2 s) (3-10) 886.br 887.ns 888.TP 10 889.NOP \f\*[B-Font]clock\f[] 890date and time of day 891.br 892.ns 893.TP 10 894.NOP \f\*[B-Font]refid\f[] 895reference ID or 896.Lk decode.html#kiss "kiss code" 897.br 898.ns 899.TP 10 900.NOP \f\*[B-Font]reftime\f[] 901reference time 902.br 903.ns 904.TP 10 905.NOP \f\*[B-Font]offset\f[] 906combined offset of server relative to this host 907.br 908.ns 909.TP 10 910.NOP \f\*[B-Font]sys_jitter\f[] 911combined system jitter 912.br 913.ns 914.TP 10 915.NOP \f\*[B-Font]frequency\f[] 916frequency offset (PPM) relative to hardware clock 917.br 918.ns 919.TP 10 920.NOP \f\*[B-Font]clk_wander\f[] 921clock frequency wander (PPM) 922.br 923.ns 924.TP 10 925.NOP \f\*[B-Font]clk_jitter\f[] 926clock jitter 927.br 928.ns 929.TP 10 930.NOP \f\*[B-Font]tai\f[] 931TAI-UTC offset (s) 932.br 933.ns 934.TP 10 935.NOP \f\*[B-Font]leapsec\f[] 936NTP seconds when the next leap second is/was inserted 937.br 938.ns 939.TP 10 940.NOP \f\*[B-Font]expire\f[] 941NTP seconds when the NIST leapseconds file expires 942.PP 943The jitter and wander statistics are exponentially-weighted RMS averages. 944The system jitter is defined in the NTPv4 specification; 945the clock jitter statistic is computed by the clock discipline module. 946.sp \n(Ppu 947.ne 2 948 949When the NTPv4 daemon is compiled with the OpenSSL software library, 950additional system variables are displayed, 951including some or all of the following, 952depending on the particular Autokey dance: 953.TP 10 954.NOP Variable 955Description 956.br 957.ns 958.TP 10 959.NOP \f\*[B-Font]host\f[] 960Autokey host name for this host 961.br 962.ns 963.TP 10 964.NOP \f\*[B-Font]ident\f[] 965Autokey group name for this host 966.br 967.ns 968.TP 10 969.NOP \f\*[B-Font]flags\f[] 970host flags (see Autokey specification) 971.br 972.ns 973.TP 10 974.NOP \f\*[B-Font]digest\f[] 975OpenSSL message digest algorithm 976.br 977.ns 978.TP 10 979.NOP \f\*[B-Font]signature\f[] 980OpenSSL digest/signature scheme 981.br 982.ns 983.TP 10 984.NOP \f\*[B-Font]update\f[] 985NTP seconds at last signature update 986.br 987.ns 988.TP 10 989.NOP \f\*[B-Font]cert\f[] 990certificate subject, issuer and certificate flags 991.br 992.ns 993.TP 10 994.NOP \f\*[B-Font]until\f[] 995NTP seconds when the certificate expires 996.PP 997.SS Peer Variables 998The following peer variables appear in the 999\f\*[B-Font]rv\f[] 1000billboard for each association. 1001Not all variables are displayed in some configurations. 1002.TP 10 1003.NOP Variable 1004Description 1005.br 1006.ns 1007.TP 10 1008.NOP \f\*[B-Font]associd\f[] 1009association ID 1010.br 1011.ns 1012.TP 10 1013.NOP \f\*[B-Font]status\f[] 1014.Lk decode.html#peer "peer status word" 1015.br 1016.ns 1017.TP 10 1018.NOP \f\*[B-Font]srcadr\f[] 1019source (remote) IP address 1020.br 1021.ns 1022.TP 10 1023.NOP \f\*[B-Font]srcport\f[] 1024source (remote) port 1025.br 1026.ns 1027.TP 10 1028.NOP \f\*[B-Font]dstadr\f[] 1029destination (local) IP address 1030.br 1031.ns 1032.TP 10 1033.NOP \f\*[B-Font]dstport\f[] 1034destination (local) port 1035.br 1036.ns 1037.TP 10 1038.NOP \f\*[B-Font]leap\f[] 1039leap indicator (0-3) 1040.br 1041.ns 1042.TP 10 1043.NOP \f\*[B-Font]stratum\f[] 1044stratum (0-15) 1045.br 1046.ns 1047.TP 10 1048.NOP \f\*[B-Font]precision\f[] 1049precision (log2 s) 1050.br 1051.ns 1052.TP 10 1053.NOP \f\*[B-Font]rootdelay\f[] 1054total roundtrip delay to the primary reference clock 1055.br 1056.ns 1057.TP 10 1058.NOP \f\*[B-Font]rootdisp\f[] 1059total root dispersion to the primary reference clock 1060.br 1061.ns 1062.TP 10 1063.NOP \f\*[B-Font]refid\f[] 1064reference ID or 1065.Lk decode.html#kiss "kiss code" 1066.br 1067.ns 1068.TP 10 1069.NOP \f\*[B-Font]reftime\f[] 1070reference time 1071.br 1072.ns 1073.TP 10 1074.NOP \f\*[B-Font]reach\f[] 1075reach register (octal) 1076.br 1077.ns 1078.TP 10 1079.NOP \f\*[B-Font]unreach\f[] 1080unreach counter 1081.br 1082.ns 1083.TP 10 1084.NOP \f\*[B-Font]hmode\f[] 1085host mode (1-6) 1086.br 1087.ns 1088.TP 10 1089.NOP \f\*[B-Font]pmode\f[] 1090peer mode (1-5) 1091.br 1092.ns 1093.TP 10 1094.NOP \f\*[B-Font]hpoll\f[] 1095host poll exponent (log2 s) (3-17) 1096.br 1097.ns 1098.TP 10 1099.NOP \f\*[B-Font]ppoll\f[] 1100peer poll exponent (log2 s) (3-17) 1101.br 1102.ns 1103.TP 10 1104.NOP \f\*[B-Font]headway\f[] 1105headway (see 1106.Lk rate.html "Rate Management and the Kiss-o'-Death Packet" ) 1107.br 1108.ns 1109.TP 10 1110.NOP \f\*[B-Font]flash\f[] 1111.Lk decode.html#flash "flash status word" 1112.br 1113.ns 1114.TP 10 1115.NOP \f\*[B-Font]offset\f[] 1116filter offset 1117.br 1118.ns 1119.TP 10 1120.NOP \f\*[B-Font]delay\f[] 1121filter delay 1122.br 1123.ns 1124.TP 10 1125.NOP \f\*[B-Font]dispersion\f[] 1126filter dispersion 1127.br 1128.ns 1129.TP 10 1130.NOP \f\*[B-Font]jitter\f[] 1131filter jitter 1132.br 1133.ns 1134.TP 10 1135.NOP \f\*[B-Font]ident\f[] 1136Autokey group name for this association 1137.br 1138.ns 1139.TP 10 1140.NOP \f\*[B-Font]bias\f[] 1141unicast/broadcast bias 1142.br 1143.ns 1144.TP 10 1145.NOP \f\*[B-Font]xleave\f[] 1146interleave delay (see 1147.Lk xleave.html "NTP Interleaved Modes" ) 1148.PP 1149The 1150\f\*[B-Font]bias\f[] 1151variable is calculated when the first broadcast packet is received 1152after the calibration volley. 1153It represents the offset of the broadcast subgraph relative to the unicast subgraph. 1154The 1155\f\*[B-Font]xleave\f[] 1156variable appears only for the interleaved symmetric and interleaved modes. 1157It represents the internal queuing, buffering and transmission delays 1158for the preceding packet. 1159.sp \n(Ppu 1160.ne 2 1161 1162When the NTPv4 daemon is compiled with the OpenSSL software library, 1163additional peer variables are displayed, including the following: 1164.TP 10 1165.NOP Variable 1166Description 1167.br 1168.ns 1169.TP 10 1170.NOP \f\*[B-Font]flags\f[] 1171peer flags (see Autokey specification) 1172.br 1173.ns 1174.TP 10 1175.NOP \f\*[B-Font]host\f[] 1176Autokey server name 1177.br 1178.ns 1179.TP 10 1180.NOP \f\*[B-Font]flags\f[] 1181peer flags (see Autokey specification) 1182.br 1183.ns 1184.TP 10 1185.NOP \f\*[B-Font]signature\f[] 1186OpenSSL digest/signature scheme 1187.br 1188.ns 1189.TP 10 1190.NOP \f\*[B-Font]initsequence\f[] 1191initial key ID 1192.br 1193.ns 1194.TP 10 1195.NOP \f\*[B-Font]initkey\f[] 1196initial key index 1197.br 1198.ns 1199.TP 10 1200.NOP \f\*[B-Font]timestamp\f[] 1201Autokey signature timestamp 1202.PP 1203.SS Clock Variables 1204The following clock variables appear in the 1205\f\*[B-Font]cv\f[] 1206billboard for each association with a reference clock. 1207Not all variables are displayed in some configurations. 1208.TP 10 1209.NOP Variable 1210Description 1211.br 1212.ns 1213.TP 10 1214.NOP \f\*[B-Font]associd\f[] 1215association ID 1216.br 1217.ns 1218.TP 10 1219.NOP \f\*[B-Font]status\f[] 1220.Lk decode.html#clock "clock status word" 1221.br 1222.ns 1223.TP 10 1224.NOP \f\*[B-Font]device\f[] 1225device description 1226.br 1227.ns 1228.TP 10 1229.NOP \f\*[B-Font]timecode\f[] 1230ASCII time code string (specific to device) 1231.br 1232.ns 1233.TP 10 1234.NOP \f\*[B-Font]poll\f[] 1235poll messages sent 1236.br 1237.ns 1238.TP 10 1239.NOP \f\*[B-Font]noreply\f[] 1240no reply 1241.br 1242.ns 1243.TP 10 1244.NOP \f\*[B-Font]badformat\f[] 1245bad format 1246.br 1247.ns 1248.TP 10 1249.NOP \f\*[B-Font]baddata\f[] 1250bad date or time 1251.br 1252.ns 1253.TP 10 1254.NOP \f\*[B-Font]fudgetime1\f[] 1255fudge time 1 1256.br 1257.ns 1258.TP 10 1259.NOP \f\*[B-Font]fudgetime2\f[] 1260fudge time 2 1261.br 1262.ns 1263.TP 10 1264.NOP \f\*[B-Font]stratum\f[] 1265driver stratum 1266.br 1267.ns 1268.TP 10 1269.NOP \f\*[B-Font]refid\f[] 1270driver reference ID 1271.br 1272.ns 1273.TP 10 1274.NOP \f\*[B-Font]flags\f[] 1275driver flags 1276.PP 1277.SH "OPTIONS" 1278.TP 1279.NOP \f\*[B-Font]\-4\f[], \f\*[B-Font]\-\-ipv4\f[] 1280Force IPv4 DNS name resolution. 1281This option must not appear in combination with any of the following options: 1282ipv6. 1283.sp 1284Force DNS resolution of following host names on the command line 1285to the IPv4 namespace. 1286.TP 1287.NOP \f\*[B-Font]\-6\f[], \f\*[B-Font]\-\-ipv6\f[] 1288Force IPv6 DNS name resolution. 1289This option must not appear in combination with any of the following options: 1290ipv4. 1291.sp 1292Force DNS resolution of following host names on the command line 1293to the IPv6 namespace. 1294.TP 1295.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]cmd\f[], \f\*[B-Font]\-\-command\f[]=\f\*[I-Font]cmd\f[] 1296run a command and exit. 1297This option may appear an unlimited number of times. 1298.sp 1299The following argument is interpreted as an interactive format command 1300and is added to the list of commands to be executed on the specified 1301host(s). 1302.TP 1303.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[] 1304Increase debug verbosity level. 1305This option may appear an unlimited number of times. 1306.sp 1307.TP 1308.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[] 1309Set the debug verbosity level. 1310This option may appear an unlimited number of times. 1311This option takes an integer number as its argument. 1312.sp 1313.TP 1314.NOP \f\*[B-Font]\-i\f[], \f\*[B-Font]\-\-interactive\f[] 1315Force ntpq to operate in interactive mode. 1316This option must not appear in combination with any of the following options: 1317command, peers. 1318.sp 1319Force \fBntpq\fP to operate in interactive mode. 1320Prompts will be written to the standard output and 1321commands read from the standard input. 1322.TP 1323.NOP \f\*[B-Font]\-n\f[], \f\*[B-Font]\-\-numeric\f[] 1324numeric host addresses. 1325.sp 1326Output all host addresses in dotted-quad numeric format rather than 1327converting to the canonical host names. 1328.TP 1329.NOP \f\*[B-Font]\-\-old\-rv\f[] 1330Always output status line with readvar. 1331.sp 1332By default, \fBntpq\fP now suppresses the \fBassocid=...\fP 1333line that precedes the output of \fBreadvar\fP 1334(alias \fBrv\fP) when a single variable is requested, such as 1335\fBntpq \-c "rv 0 offset"\fP. 1336This option causes \fBntpq\fP to include both lines of output 1337for a single-variable \fBreadvar\fP. 1338Using an environment variable to 1339preset this option in a script will enable both older and 1340newer \fBntpq\fP to behave identically in this regard. 1341.TP 1342.NOP \f\*[B-Font]\-p\f[], \f\*[B-Font]\-\-peers\f[] 1343Print a list of the peers. 1344This option must not appear in combination with any of the following options: 1345interactive. 1346.sp 1347Print a list of the peers known to the server as well as a summary 1348of their state. This is equivalent to the 'peers' interactive command. 1349.TP 1350.NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-wide\f[] 1351Display the full 'remote' value. 1352.sp 1353Display the full value of the 'remote' value. If this requires 1354more than 15 characters, display the full value, emit a newline, 1355and continue the data display properly indented on the next line. 1356.TP 1357.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] 1358Display usage information and exit. 1359.TP 1360.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] 1361Pass the extended usage information through a pager. 1362.TP 1363.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]] 1364Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP 1365configuration file listed in the \fBOPTION PRESETS\fP section, below. 1366The command will exit after updating the config file. 1367.TP 1368.NOP \f\*[B-Font]\-<\f[] \f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[] 1369Load options from \fIcfgfile\fP. 1370The \fIno-load-opts\fP form will disable the loading 1371of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early, 1372out of order. 1373.TP 1374.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}] 1375Output version of program and exit. The default mode is `v', a simple 1376version. The `c' mode will print copyright information and `n' will 1377print the full copyright notice. 1378.PP 1379.SH "OPTION PRESETS" 1380Any option that is not marked as \fInot presettable\fP may be preset 1381by loading values from configuration ("RC" or ".INI") file(s) and values from 1382environment variables named: 1383.nf 1384 \fBNTPQ_<option-name>\fP or \fBNTPQ\fP 1385.fi 1386.ad 1387The environmental presets take precedence (are processed later than) 1388the configuration files. 1389The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". 1390If any of these are directories, then the file \fI.ntprc\fP 1391is searched for within those directories. 1392.SH "ENVIRONMENT" 1393See \fBOPTION PRESETS\fP for configuration environment variables. 1394.SH "FILES" 1395See \fBOPTION PRESETS\fP for configuration files. 1396.SH "EXIT STATUS" 1397One of the following exit values will be returned: 1398.TP 1399.NOP 0 " (EXIT_SUCCESS)" 1400Successful program execution. 1401.TP 1402.NOP 1 " (EXIT_FAILURE)" 1403The operation failed or the command syntax was not valid. 1404.TP 1405.NOP 66 " (EX_NOINPUT)" 1406A specified configuration file could not be loaded. 1407.TP 1408.NOP 70 " (EX_SOFTWARE)" 1409libopts had an internal operational error. Please report 1410it to autogen-users@lists.sourceforge.net. Thank you. 1411.PP 1412.SH "AUTHORS" 1413The University of Delaware and Network Time Foundation 1414.SH "COPYRIGHT" 1415Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved. 1416This program is released under the terms of the NTP license, <http://ntp.org/license>. 1417.SH "BUGS" 1418Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org 1419.SH "NOTES" 1420This manual page was \fIAutoGen\fP-erated from the \fBntpq\fP 1421option definitions. 1422