1330567Sgordon.Dd February 27 2018 2275970Scy.Dt NTPQ @NTPQ_MS@ User Commands 3275970Scy.Os 4275970Scy.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) 5275970Scy.\" 6330567Sgordon.\" It has been AutoGen-ed February 27, 2018 at 05:15:28 PM by AutoGen 5.18.5 7275970Scy.\" From the definitions ntpq-opts.def 8275970Scy.\" and the template file agmdoc-cmd.tpl 9275970Scy.Sh NAME 10275970Scy.Nm ntpq 11275970Scy.Nd standard NTP query program 12275970Scy.Sh SYNOPSIS 13275970Scy.Nm 14275970Scy.\" Mixture of short (flag) options and long options 15275970Scy.Op Fl flags 16275970Scy.Op Fl flag Op Ar value 17275970Scy.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc 18275970Scy[ host ...] 19275970Scy.Pp 20275970Scy.Sh DESCRIPTION 21330567Sgordon.Pp 22275970ScyThe 23275970Scy.Nm 24330567Sgordonutility program is used to query NTP servers to monitor NTP operations 25330567Sgordonand performance, requesting 26275970Scyinformation about current state and/or changes in that state. 27275970ScyThe program may be run either in interactive mode or controlled using 28275970Scycommand line arguments. 29275970ScyRequests to read and write arbitrary 30275970Scyvariables can be assembled, with raw and pretty\-printed output 31275970Scyoptions being available. 32275970ScyThe 33275970Scy.Nm 34275970Scyutility can also obtain and print a 35275970Scylist of peers in a common format by sending multiple queries to the 36275970Scyserver. 37330567Sgordon.Pp 38275970ScyIf one or more request options is included on the command line 39275970Scywhen 40275970Scy.Nm 41275970Scyis executed, each of the requests will be sent 42275970Scyto the NTP servers running on each of the hosts given as command 43275970Scyline arguments, or on localhost by default. 44275970ScyIf no request options 45275970Scyare given, 46275970Scy.Nm 47275970Scywill attempt to read commands from the 48275970Scystandard input and execute these on the NTP server running on the 49275970Scyfirst host given on the command line, again defaulting to localhost 50275970Scywhen no other host is specified. 51275970ScyThe 52275970Scy.Nm 53275970Scyutility will prompt for 54275970Scycommands if the standard input is a terminal device. 55330567Sgordon.Pp 56275970Scy.Nm 57275970Scyuses NTP mode 6 packets to communicate with the 58275970ScyNTP server, and hence can be used to query any compatible server on 59275970Scythe network which permits it. 60275970ScyNote that since NTP is a UDP protocol 61275970Scythis communication will be somewhat unreliable, especially over 62275970Scylarge distances in terms of network topology. 63275970ScyThe 64275970Scy.Nm 65275970Scyutility makes 66275970Scyone attempt to retransmit requests, and will time requests out if 67275970Scythe remote host is not heard from within a suitable timeout 68275970Scytime. 69330567Sgordon.Pp 70330567SgordonNote that in contexts where a host name is expected, a 71330567Sgordon.Fl 4 72330567Sgordonqualifier preceding the host name forces resolution to the IPv4 73330567Sgordonnamespace, while a 74330567Sgordon.Fl 6 75330567Sgordonqualifier forces resolution to the IPv6 namespace. 76330567SgordonFor examples and usage, see the 77330567Sgordon.Dq NTP Debugging Techniques 78330567Sgordonpage. 79330567Sgordon.Pp 80275970ScySpecifying a 81275970Scycommand line option other than 82275970Scy.Fl i 83275970Scyor 84275970Scy.Fl n 85275970Scywill 86275970Scycause the specified query (queries) to be sent to the indicated 87275970Scyhost(s) immediately. 88275970ScyOtherwise, 89275970Scy.Nm 90275970Scywill attempt to read 91275970Scyinteractive format commands from the standard input. 92275970Scy.Ss "Internal Commands" 93330567Sgordon.Pp 94275970ScyInteractive format commands consist of a keyword followed by zero 95275970Scyto four arguments. 96275970ScyOnly enough characters of the full keyword to 97275970Scyuniquely identify the command need be typed. 98330567Sgordon.Pp 99275970ScyA 100275970Scynumber of interactive format commands are executed entirely within 101275970Scythe 102275970Scy.Nm 103330567Sgordonutility itself and do not result in NTP 104275970Scyrequests being sent to a server. 105275970ScyThese are described following. 106330567Sgordon.Bl -tag -width "help [command]" -compact -offset indent 107330567Sgordon.It Ic ? Op Ar command 108330567Sgordon.It Ic help Op Ar command 109275970ScyA 110275970Scy.Ql \&? 111330567Sgordonby itself will print a list of all the commands 112330567Sgordonknown to 113275970Scy.Nm . 114275970ScyA 115275970Scy.Ql \&? 116330567Sgordonfollowed by a command name will print function and usage 117275970Scyinformation about the command. 118330567Sgordon.It Ic addvars Ar name Ns Oo \&= Ns Ar value Oc Ns Op ,... 119330567Sgordon.It Ic rmvars Ar name Ns Op ,... 120275970Scy.It Ic clearvars 121275970Scy.It Ic showvars 122330567SgordonThe arguments to this command consist of a list of 123275970Scyitems of the form 124330567Sgordon.Ar name Ns Op \&= Ns Ar value , 125275970Scywhere the 126330567Sgordon.No \&= Ns Ar value 127275970Scyis ignored, and can be omitted, 128275970Scyin requests to the server to read variables. 129275970ScyThe 130275970Scy.Nm 131330567Sgordonutility maintains an internal list in which data to be included in 132330567Sgordonmessages can be assembled, and displayed or set using the 133275970Scy.Ic readlist 134275970Scyand 135275970Scy.Ic writelist 136275970Scycommands described below. 137275970ScyThe 138275970Scy.Ic addvars 139275970Scycommand allows variables and their optional values to be added to 140275970Scythe list. 141275970ScyIf more than one variable is to be added, the list should 142275970Scybe comma\-separated and not contain white space. 143275970ScyThe 144275970Scy.Ic rmvars 145275970Scycommand can be used to remove individual variables from the list, 146275970Scywhile the 147330567Sgordon.Ic clearvars 148275970Scycommand removes all variables from the 149275970Scylist. 150275970ScyThe 151275970Scy.Ic showvars 152275970Scycommand displays the current list of optional variables. 153330567Sgordon.It Ic authenticate Op Cm yes Ns | Ns Cm no 154275970ScyNormally 155275970Scy.Nm 156275970Scydoes not authenticate requests unless 157275970Scythey are write requests. 158275970ScyThe command 159330567Sgordon.Ic authenticate Cm yes 160275970Scycauses 161275970Scy.Nm 162275970Scyto send authentication with all requests it 163275970Scymakes. 164275970ScyAuthenticated requests causes some servers to handle 165330567Sgordonrequests slightly differently. 166275970ScyThe command 167330567Sgordon.Ic authenticate 168275970Scycauses 169275970Scy.Nm 170275970Scyto display whether or not 171330567Sgordonit is currently authenticating requests. 172275970Scy.It Ic cooked 173275970ScyCauses output from query commands to be "cooked", so that 174275970Scyvariables which are recognized by 175275970Scy.Nm 176275970Scywill have their 177275970Scyvalues reformatted for human consumption. 178275970ScyVariables which 179275970Scy.Nm 180330567Sgordoncould not decode completely are 181275970Scymarked with a trailing 182275970Scy.Ql \&? . 183330567Sgordon.It Ic debug Op Cm more Ns | Ns Cm less Ns | Ns Cm off 184275970ScyWith no argument, displays the current debug level. 185330567SgordonOtherwise, the debugging level is changed as indicated. 186330567Sgordon.It Ic delay Op Ar milliseconds 187275970ScySpecify a time interval to be added to timestamps included in 188275970Scyrequests which require authentication. 189275970ScyThis is used to enable 190275970Scy(unreliable) server reconfiguration over long delay network paths 191275970Scyor between machines whose clocks are unsynchronized. 192275970ScyActually the 193275970Scyserver does not now require timestamps in authenticated requests, 194275970Scyso this command may be obsolete. 195330567SgordonWithout any arguments, displays the current delay. 196330567Sgordon.It Ic drefid Op Cm hash Ns | Ns Cm ipv4 197330567SgordonDisplay refids as IPv4 or hash. 198330567SgordonWithout any arguments, displays whether refids are shown as IPv4 199330567Sgordonaddresses or hashes. 200275970Scy.It Ic exit 201275970ScyExit 202275970Scy.Nm . 203330567Sgordon.It Ic host Op Ar name 204275970ScySet the host to which future queries will be sent. 205330567SgordonThe 206330567Sgordon.Ar name 207275970Scymay be either a host name or a numeric address. 208330567SgordonWithout any arguments, displays the current host. 209330567Sgordon.It Ic hostnames Op Cm yes Ns | Ns Cm no 210275970ScyIf 211275970Scy.Cm yes 212275970Scyis specified, host names are printed in 213275970Scyinformation displays. 214275970ScyIf 215275970Scy.Cm no 216275970Scyis specified, numeric 217275970Scyaddresses are printed instead. 218275970ScyThe default is 219275970Scy.Cm yes , 220275970Scyunless 221275970Scymodified using the command line 222275970Scy.Fl n 223275970Scyswitch. 224330567SgordonWithout any arguments, displays whether host names or numeric addresses 225330567Sgordonare shown. 226330567Sgordon.It Ic keyid Op Ar keyid 227275970ScyThis command allows the specification of a key number to be 228275970Scyused to authenticate configuration requests. 229275970ScyThis must correspond 230285612Sdelphijto the 231285612Sdelphij.Cm controlkey 232285612Sdelphijkey number the server has been configured to use for this 233275970Scypurpose. 234330567SgordonWithout any arguments, displays the current 235330567Sgordon.Ar keyid . 236330567Sgordon.It Ic keytype Op Ar digest 237330567SgordonSpecify the digest algorithm to use for authenticating requests, with default 238330567Sgordon.Cm MD5 . 239275970ScyIf 240275970Scy.Nm 241330567Sgordonwas built with OpenSSL support, and OpenSSL is installed, 242330567Sgordon.Ar digest 243330567Sgordoncan be any message digest algorithm supported by OpenSSL. 244275970ScyIf no argument is given, the current 245330567Sgordon.Ic keytype Ar digest 246330567Sgordonalgorithm used is displayed. 247330567Sgordon.It Ic ntpversion Op Cm 1 Ns | Ns Cm 2 Ns | Ns Cm 3 Ns | Ns Cm 4 248275970ScySets the NTP version number which 249275970Scy.Nm 250275970Scyclaims in 251275970Scypackets. 252275970ScyDefaults to 3, and note that mode 6 control messages (and 253275970Scymodes, for that matter) didn't exist in NTP version 1. 254275970ScyThere appear 255275970Scyto be no servers left which demand version 1. 256275970ScyWith no argument, displays the current NTP version that will be used 257275970Scywhen communicating with servers. 258275970Scy.It Ic passwd 259275970ScyThis command prompts you to type in a password (which will not 260275970Scybe echoed) which will be used to authenticate configuration 261275970Scyrequests. 262275970ScyThe password must correspond to the key configured for 263275970Scyuse by the NTP server for this purpose if such requests are to be 264275970Scysuccessful. 265330567Sgordon.It Ic poll Oo Ar n Oc Op Cm verbose 266330567SgordonPoll an NTP server in client mode 267330567Sgordon.Ar n 268330567Sgordontimes. 269330567SgordonPoll not implemented yet. 270275970Scy.It Ic quit 271275970ScyExit 272275970Scy.Nm . 273275970Scy.It Ic raw 274275970ScyCauses all output from query commands is printed as received 275275970Scyfrom the remote server. 276275970ScyThe only formating/interpretation done on 277275970Scythe data is to transform nonascii data into a printable (but barely 278275970Scyunderstandable) form. 279330567Sgordon.It Ic timeout Op Ar milliseconds 280275970ScySpecify a timeout period for responses to server queries. 281275970ScyThe 282275970Scydefault is about 5000 milliseconds. 283330567SgordonWithout any arguments, displays the current timeout period. 284275970ScyNote that since 285275970Scy.Nm 286275970Scyretries each query once after a timeout, the total waiting time for 287275970Scya timeout will be twice the timeout value set. 288275970Scy.It Ic version 289330567SgordonDisplay the version of the 290275970Scy.Nm 291275970Scyprogram. 292275970Scy.El 293275970Scy.Ss "Control Message Commands" 294330567SgordonAssociation ids are used to identify system, peer and clock variables. 295330567SgordonSystem variables are assigned an association id of zero and system name 296330567Sgordonspace, while each association is assigned a nonzero association id and 297330567Sgordonpeer namespace. 298330567SgordonMost control commands send a single message to the server and expect a 299330567Sgordonsingle response message. 300275970ScyThe exceptions are the 301330567Sgordon.Ic peers 302275970Scycommand, which sends a series of messages, 303275970Scyand the 304330567Sgordon.Ic mreadlist 305275970Scyand 306330567Sgordon.Ic mreadvar 307275970Scycommands, which iterate over a range of associations. 308275970Scy.Bl -tag -width "something" -compact -offset indent 309330567Sgordon.It Ic apeers 310330567SgordonDisplay a list of peers in the form: 311330567Sgordon.Dl [tally]remote refid assid st t when pool reach delay offset jitter 312330567Sgordonwhere the output is just like the 313330567Sgordon.Ic peers 314330567Sgordoncommand except that the 315330567Sgordon.Cm refid 316330567Sgordonis displayed in hex format and the association number is also displayed. 317330567Sgordon.It Ic associations 318275970ScyDisplay a list of mobilized associations in the form: 319275970Scy.Dl ind assid status conf reach auth condition last_event cnt 320330567Sgordon.Bl -column -offset indent ".Sy Variable" "see the select field of the peer status word" 321330567Sgordon.It Sy Variable Ta Sy Description 322330567Sgordon.It Cm ind Ta index on this list 323330567Sgordon.It Cm assid Ta association id 324330567Sgordon.It Cm status Ta peer status word 325330567Sgordon.It Cm conf Ta Cm yes : No persistent, Cm no : No ephemeral 326330567Sgordon.It Cm reach Ta Cm yes : No reachable, Cm no : No unreachable 327330567Sgordon.It Cm auth Ta Cm ok , Cm yes , Cm bad No and Cm none 328330567Sgordon.It Cm condition Ta selection status \&(see the Cm select No field of the peer status word\&) 329330567Sgordon.It Cm last_event Ta event report \&(see the Cm event No field of the peer status word\&) 330330567Sgordon.It Cm cnt Ta event count \&(see the Cm count No field of the peer status word\&) 331275970Scy.El 332330567Sgordon.It Ic authinfo 333330567SgordonDisplay the authentication statistics counters: 334330567Sgordontime since reset, stored keys, free keys, key lookups, keys not found, 335330567Sgordonuncached keys, expired keys, encryptions, decryptions. 336330567Sgordon.It Ic clocklist Op Ar associd 337330567Sgordon.It Ic cl Op Ar associd 338330567SgordonDisplay all clock variables in the variable list for those associations 339330567Sgordonsupporting a reference clock. 340330567Sgordon.It Ic clockvar Oo Ar associd Oc Oo Ar name Ns Oo \&= Ns Ar value Oc Ns Oc Ns Op ,... 341330567Sgordon.It Ic cv Oo Ar associd Oc Oo Ar name Ns Oo \&= Ns Ar value Oc Ns Oc Ns Op ,... 342330567SgordonDisplay a list of clock variables for those associations supporting a 343330567Sgordonreference clock. 344330567Sgordon.It Ic :config Ar "configuration command line" 345330567SgordonSend the remainder of the command line, including whitespace, to the 346330567Sgordonserver as a run\-time configuration command in the same format as a line 347330567Sgordonin the configuration file. 348330567SgordonThis command is experimental until further notice and clarification. 349330567SgordonAuthentication is of course required. 350330567Sgordon.It Ic config\-from\-file Ar filename 351330567SgordonSend each line of 352275970Scy.Ar filename 353330567Sgordonto the server as run\-time configuration commands in the same format as 354330567Sgordonlines in the configuration file. 355330567SgordonThis command is experimental until further notice and clarification. 356330567SgordonAuthentication is required. 357275970Scy.It Ic ifstats 358330567SgordonDisplay status and statistics counters for each local network interface address: 359330567Sgordoninterface number, interface name and address or broadcast, drop, flag, 360330567Sgordonttl, mc, received, sent, send failed, peers, uptime. 361330567SgordonAuthentication is required. 362275970Scy.It Ic iostats 363330567SgordonDisplay network and reference clock I/O statistics: 364330567Sgordontime since reset, receive buffers, free receive buffers, used receive buffers, 365330567Sgordonlow water refills, dropped packets, ignored packets, received packets, 366330567Sgordonpackets sent, packet send failures, input wakeups, useful input wakeups. 367275970Scy.It Ic kerninfo 368330567SgordonDisplay kernel loop and PPS statistics: 369330567Sgordonassocid, status, pll offset, pll frequency, maximum error, 370330567Sgordonestimated error, kernel status, pll time constant, precision, 371330567Sgordonfrequency tolerance, pps frequency, pps stability, pps jitter, 372330567Sgordoncalibration interval, calibration cycles, jitter exceeded, 373330567Sgordonstability exceeded, calibration errors. 374330567SgordonAs with other ntpq output, times are in milliseconds; very small values 375330567Sgordonmay be shown as exponentials. 376330567SgordonThe precision value displayed is in milliseconds as well, unlike the 377330567Sgordonprecision system variable. 378275970Scy.It Ic lassociations 379330567SgordonPerform the same function as the associations command, except display 380330567Sgordonmobilized and unmobilized associations, including all clients. 381330567Sgordon.It Ic lopeers Op Fl 4 Ns | Ns Fl 6 382330567SgordonDisplay a list of all peers and clients showing 383330567Sgordon.Cm dstadr 384330567Sgordon(associated with the given IP version). 385330567Sgordon.It Ic lpassociations 386330567SgordonDisplay the last obtained list of associations, including all clients. 387330567Sgordon.It Ic lpeers Op Fl 4 Ns | Ns Fl 6 388330567SgordonDisplay a list of all peers and clients (associated with the given IP version). 389330567Sgordon.It Ic monstats 390330567SgordonDisplay monitor facility status, statistics, and limits: 391330567Sgordonenabled, addresses, peak addresses, maximum addresses, 392330567Sgordonreclaim above count, reclaim older than, kilobytes, maximum kilobytes. 393330567Sgordon.It Ic mreadlist Ar associdlo Ar associdhi 394330567Sgordon.It Ic mrl Ar associdlo Ar associdhi 395330567SgordonPerform the same function as the 396330567Sgordon.Ic readlist 397330567Sgordoncommand for a range of association ids. 398330567Sgordon.It Ic mreadvar Ar associdlo Ar associdhi Oo Ar name Oc Ns Op ,... 399330567SgordonThis range may be determined from the list displayed by any 400330567Sgordoncommand showing associations. 401330567Sgordon.It Ic mrv Ar associdlo Ar associdhi Oo Ar name Oc Ns Op ,... 402330567SgordonPerform the same function as the 403330567Sgordon.Ic readvar 404330567Sgordoncommand for a range of association ids. 405330567SgordonThis range may be determined from the list displayed by any 406330567Sgordoncommand showing associations. 407330567Sgordon.It Xo Ic mrulist Oo Cm limited | Cm kod | Cm mincount Ns \&= Ns Ar count | 408330567Sgordon.Cm laddr Ns \&= Ns Ar localaddr | Cm sort Ns \&= Ns Oo \&\- Oc Ns Ar sortorder | 409330567Sgordon.Cm resany Ns \&= Ns Ar hexmask | Cm resall Ns \&= Ns Ar hexmask Oc 410275970Scy.Xc 411330567SgordonDisplay traffic counts of the most recently seen source addresses 412330567Sgordoncollected and maintained by the monitor facility. 413275970ScyWith the exception of 414330567Sgordon.Cm sort Ns \&= Ns Oo \&\- Oc Ns Ar sortorder , 415275970Scythe options filter the list returned by 416330567Sgordon.Xr ntpd 8 . 417275970ScyThe 418275970Scy.Cm limited 419275970Scyand 420275970Scy.Cm kod 421330567Sgordonoptions return only entries representing client addresses from which the 422330567Sgordonlast packet received triggered either discarding or a KoD response. 423275970ScyThe 424275970Scy.Cm mincount Ns = Ns Ar count 425275970Scyoption filters entries representing less than 426275970Scy.Ar count 427275970Scypackets. 428275970ScyThe 429275970Scy.Cm laddr Ns = Ns Ar localaddr 430275970Scyoption filters entries for packets received on any local address other than 431275970Scy.Ar localaddr . 432275970Scy.Cm resany Ns = Ns Ar hexmask 433275970Scyand 434275970Scy.Cm resall Ns = Ns Ar hexmask 435275970Scyfilter entries containing none or less than all, respectively, of the bits in 436275970Scy.Ar hexmask , 437275970Scywhich must begin with 438275970Scy.Cm 0x . 439275970ScyThe 440275970Scy.Ar sortorder 441275970Scydefaults to 442275970Scy.Cm lstint 443330567Sgordonand may be 444275970Scy.Cm addr , 445330567Sgordon.Cm avgint , 446275970Scy.Cm count , 447275970Scy.Cm lstint , 448330567Sgordonor any of those preceded by 449330567Sgordon.Ql \&\- 450330567Sgordonto reverse the sort order. 451275970ScyThe output columns are: 452275970Scy.Bl -tag -width "something" -compact -offset indent 453275970Scy.It Column 454275970ScyDescription 455275970Scy.It Ic lstint 456330567SgordonInterval in seconds between the receipt of the most recent packet from 457330567Sgordonthis address and the completion of the retrieval of the MRU list by 458275970Scy.Nm . 459275970Scy.It Ic avgint 460275970ScyAverage interval in s between packets from this address. 461275970Scy.It Ic rstr 462275970ScyRestriction flags associated with this address. 463275970ScyMost are copied unchanged from the matching 464275970Scy.Ic restrict 465330567Sgordoncommand, however 0x400 (kod) and 0x20 (limited) flags are cleared unless 466330567Sgordonthe last packet from this address triggered a rate control response. 467275970Scy.It Ic r 468275970ScyRate control indicator, either 469275970Scya period, 470275970Scy.Ic L 471275970Scyor 472275970Scy.Ic K 473275970Scyfor no rate control response, 474275970Scyrate limiting by discarding, or rate limiting with a KoD response, respectively. 475275970Scy.It Ic m 476275970ScyPacket mode. 477275970Scy.It Ic v 478275970ScyPacket version number. 479275970Scy.It Ic count 480275970ScyPackets received from this address. 481275970Scy.It Ic rport 482275970ScySource port of last packet from this address. 483275970Scy.It Ic remote address 484330567Sgordonhost or DNS name, numeric address, or address followed by 485275970Scyclaimed DNS name which could not be verified in parentheses. 486275970Scy.El 487330567Sgordon.It Ic opeers Op Fl 4 | Fl 6 488275970ScyObtain and print the old\-style list of all peers and clients showing 489330567Sgordon.Cm dstadr 490330567Sgordon(associated with the given IP version), 491275970Scyrather than the 492330567Sgordon.Cm refid . 493275970Scy.It Ic passociations 494275970ScyPerform the same function as the 495275970Scy.Ic associations 496275970Scycommand, 497275970Scyexcept that it uses previously stored data rather than making a new query. 498275970Scy.It Ic peers 499275970ScyDisplay a list of peers in the form: 500275970Scy.Dl [tally]remote refid st t when pool reach delay offset jitter 501275970Scy.Bl -tag -width "something" -compact -offset indent 502275970Scy.It Variable 503275970ScyDescription 504330567Sgordon.It Cm [tally] 505275970Scysingle\-character code indicating current value of the 506275970Scy.Ic select 507275970Scyfield of the 508275970Scy.Lk decode.html#peer "peer status word" 509330567Sgordon.It Cm remote 510275970Scyhost name (or IP number) of peer. 511330567SgordonThe value displayed will be truncated to 15 characters unless the 512330567Sgordon.Nm 513275970Scy.Fl w 514330567Sgordonoption is given, in which case the full value will be displayed 515330567Sgordonon the first line, and if too long, 516330567Sgordonthe remaining data will be displayed on the next line. 517330567Sgordon.It Cm refid 518330567Sgordonsource IP address or 519275970Scy.Lk decode.html#kiss "'kiss code" 520330567Sgordon.It Cm st 521330567Sgordonstratum: 0 for local reference clocks, 1 for servers with local 522330567Sgordonreference clocks, ..., 16 for unsynchronized server clocks 523330567Sgordon.It Cm t 524275970Scy.Ic u : 525275970Scyunicast or manycast client, 526275970Scy.Ic b : 527275970Scybroadcast or multicast client, 528330567Sgordon.Ic p : 529330567Sgordonpool source, 530275970Scy.Ic l : 531275970Scylocal (reference clock), 532275970Scy.Ic s : 533275970Scysymmetric (peer), 534275970Scy.Ic A : 535275970Scymanycast server, 536275970Scy.Ic B : 537275970Scybroadcast server, 538275970Scy.Ic M : 539275970Scymulticast server 540330567Sgordon.It Cm when 541330567Sgordontime in seconds, minutes, hours, or days since the last packet 542330567Sgordonwas received, or 543330567Sgordon.Ql \&\- 544330567Sgordonif a packet has never been received 545330567Sgordon.It Cm poll 546330567Sgordonpoll interval (s) 547330567Sgordon.It Cm reach 548275970Scyreach shift register (octal) 549330567Sgordon.It Cm delay 550275970Scyroundtrip delay 551330567Sgordon.It Cm offset 552275970Scyoffset of server relative to this host 553330567Sgordon.It Cm jitter 554330567Sgordonoffset RMS error estimate. 555275970Scy.El 556330567Sgordon.It Ic pstats Ar associd 557330567SgordonDisplay the statistics for the peer with the given 558330567Sgordon.Ar associd : 559330567Sgordonassocid, status, remote host, local address, time last received, 560330567Sgordontime until next send, reachability change, packets sent, 561330567Sgordonpackets received, bad authentication, bogus origin, duplicate, 562330567Sgordonbad dispersion, bad reference time, candidate order. 563330567Sgordon.It Ic readlist Op Ar associd 564330567Sgordon.It Ic rl Op Ar associd 565330567SgordonDisplay all system or peer variables. 566330567SgordonIf the 567330567Sgordon.Ar associd 568330567Sgordonis omitted, it is assumed to be zero. 569330567Sgordon.It Ic readvar Op Ar associd Ar name Ns Oo Ns = Ns Ar value Oc Op , ... 570330567Sgordon.It Ic rv Op Ar associd Ar name Ns Oo Ns = Ns Ar value Oc Op , ... 571330567SgordonDisplay the specified system or peer variables. 572275970ScyIf 573330567Sgordon.Ar associd 574275970Scyis zero, the variables are from the 575275970Scy.Sx System Variables 576275970Scyname space, otherwise they are from the 577275970Scy.Sx Peer Variables 578275970Scyname space. 579275970ScyThe 580330567Sgordon.Ar associd 581275970Scyis required, as the same name can occur in both spaces. 582275970ScyIf no 583275970Scy.Ar name 584275970Scyis included, all operative variables in the name space are displayed. 585275970ScyIn this case only, if the 586330567Sgordon.Ar associd 587330567Sgordonis omitted, it is assumed to be zero. 588275970ScyMultiple names are specified with comma separators and without whitespace. 589275970ScyNote that time values are represented in milliseconds 590275970Scyand frequency values in parts\-per\-million (PPM). 591275970ScySome NTP timestamps are represented in the format 592330567Sgordon.Ar YYYY Ns Ar MM Ar DD Ar TTTT , 593330567Sgordonwhere 594330567Sgordon.Ar YYYY 595330567Sgordonis the year, 596330567Sgordon.Ar MM 597330567Sgordonthe month of year, 598330567Sgordon.Ar DD 599330567Sgordonthe day of month and 600330567Sgordon.Ar TTTT 601330567Sgordonthe time of day. 602275970Scy.It Ic reslist 603330567SgordonDisplay the access control (restrict) list for 604275970Scy.Nm . 605330567SgordonAuthentication is required. 606275970Scy.It Ic saveconfig Ar filename 607330567SgordonSave the current configuration, 608330567Sgordonincluding any runtime modifications made by 609275970Scy.Ic :config 610275970Scyor 611275970Scy.Ic config\-from\-file , 612330567Sgordonto the NTP server host file 613275970Scy.Ar filename . 614275970ScyThis command will be rejected by the server unless 615275970Scy.Lk miscopt.html#saveconfigdir "saveconfigdir" 616275970Scyappears in the 617330567Sgordon.Xr ntpd 8 618275970Scyconfiguration file. 619275970Scy.Ar filename 620275970Scycan use 621330567Sgordon.Xr date 1 622330567Sgordonformat specifiers to substitute the current date and time, for 623330567Sgordonexample, 624330567Sgordon.D1 Ic saveconfig Pa ntp\-%Y%m%d\-%H%M%S.conf . 625275970ScyThe filename used is stored in system variable 626330567Sgordon.Cm savedconfig . 627275970ScyAuthentication is required. 628330567Sgordon.It Ic sysinfo 629330567SgordonDisplay system operational summary: 630330567Sgordonassocid, status, system peer, system peer mode, leap indicator, 631330567Sgordonstratum, log2 precision, root delay, root dispersion, 632330567Sgordonreference id, reference time, system jitter, clock jitter, 633330567Sgordonclock wander, broadcast delay, symm. auth. delay. 634330567Sgordon.It Ic sysstats 635330567SgordonDisplay system uptime and packet counts maintained in the 636330567Sgordonprotocol module: 637330567Sgordonuptime, sysstats reset, packets received, current version, 638330567Sgordonolder version, bad length or format, authentication failed, 639330567Sgordondeclined, restricted, rate limited, KoD responses, 640330567Sgordonprocessed for time. 641275970Scy.It Ic timerstats 642330567SgordonDisplay interval timer counters: 643330567Sgordontime since reset, timer overruns, calls to transmit. 644330567Sgordon.It Ic writelist Ar associd 645330567SgordonSet all system or peer variables included in the variable list. 646330567Sgordon.It Ic writevar Ar associd Ar name Ns = Ns Ar value Op , ... 647330567SgordonSet the specified variables in the variable list. 648275970ScyIf the 649330567Sgordon.Ar associd 650275970Scyis zero, the variables are from the 651275970Scy.Sx System Variables 652275970Scyname space, otherwise they are from the 653275970Scy.Sx Peer Variables 654275970Scyname space. 655275970ScyThe 656330567Sgordon.Ar associd 657275970Scyis required, as the same name can occur in both spaces. 658330567SgordonAuthentication is required. 659275970Scy.El 660275970Scy.Ss Status Words and Kiss Codes 661275970ScyThe current state of the operating program is shown 662275970Scyin a set of status words 663275970Scymaintained by the system. 664275970ScyStatus information is also available on a per\-association basis. 665330567SgordonThese words are displayed by the 666330567Sgordon.Ic readlist 667275970Scyand 668330567Sgordon.Ic associations 669275970Scycommands both in hexadecimal and in decoded short tip strings. 670275970ScyThe codes, tips and short explanations are documented on the 671275970Scy.Lk decode.html "Event Messages and Status Words" 672275970Scypage. 673275970ScyThe page also includes a list of system and peer messages, 674275970Scythe code for the latest of which is included in the status word. 675275970Scy.Pp 676275970ScyInformation resulting from protocol machine state transitions 677275970Scyis displayed using an informal set of ASCII strings called 678275970Scy.Lk decode.html#kiss "kiss codes" . 679275970ScyThe original purpose was for kiss\-o'\-death (KoD) packets 680275970Scysent by the server to advise the client of an unusual condition. 681275970ScyThey are now displayed, when appropriate, 682275970Scyin the reference identifier field in various billboards. 683275970Scy.Ss System Variables 684275970ScyThe following system variables appear in the 685330567Sgordon.Ic readlist 686275970Scybillboard. 687275970ScyNot all variables are displayed in some configurations. 688330567Sgordon.Pp 689275970Scy.Bl -tag -width "something" -compact -offset indent 690275970Scy.It Variable 691275970ScyDescription 692330567Sgordon.It Cm status 693275970Scy.Lk decode.html#sys "system status word" 694330567Sgordon.It Cm version 695275970ScyNTP software version and build time 696330567Sgordon.It Cm processor 697275970Scyhardware platform and version 698330567Sgordon.It Cm system 699275970Scyoperating system and version 700330567Sgordon.It Cm leap 701275970Scyleap warning indicator (0\-3) 702330567Sgordon.It Cm stratum 703275970Scystratum (1\-15) 704330567Sgordon.It Cm precision 705275970Scyprecision (log2 s) 706330567Sgordon.It Cm rootdelay 707275970Scytotal roundtrip delay to the primary reference clock 708330567Sgordon.It Cm rootdisp 709275970Scytotal dispersion to the primary reference clock 710330567Sgordon.It Cm refid 711330567Sgordonreference id or 712330567Sgordon.Lk decode.html#kiss "kiss code" 713330567Sgordon.It Cm reftime 714330567Sgordonreference time 715330567Sgordon.It Ic clock 716330567Sgordondate and time of day 717330567Sgordon.It Cm peer 718330567Sgordonsystem peer association id 719330567Sgordon.It Cm tc 720275970Scytime constant and poll exponent (log2 s) (3\-17) 721330567Sgordon.It Cm mintc 722275970Scyminimum time constant (log2 s) (3\-10) 723330567Sgordon.It Cm offset 724330567Sgordoncombined offset of server relative to this host 725330567Sgordon.It Cm frequency 726330567Sgordonfrequency drift (PPM) relative to hardware clock 727330567Sgordon.It Cm sys_jitter 728275970Scycombined system jitter 729330567Sgordon.It Cm clk_wander 730275970Scyclock frequency wander (PPM) 731330567Sgordon.It Cm clk_jitter 732275970Scyclock jitter 733330567Sgordon.It Cm tai 734275970ScyTAI\-UTC offset (s) 735330567Sgordon.It Cm leapsec 736275970ScyNTP seconds when the next leap second is/was inserted 737330567Sgordon.It Cm expire 738275970ScyNTP seconds when the NIST leapseconds file expires 739275970Scy.El 740275970ScyThe jitter and wander statistics are exponentially\-weighted RMS averages. 741275970ScyThe system jitter is defined in the NTPv4 specification; 742275970Scythe clock jitter statistic is computed by the clock discipline module. 743275970Scy.Pp 744275970ScyWhen the NTPv4 daemon is compiled with the OpenSSL software library, 745275970Scyadditional system variables are displayed, 746275970Scyincluding some or all of the following, 747275970Scydepending on the particular Autokey dance: 748275970Scy.Bl -tag -width "something" -compact -offset indent 749275970Scy.It Variable 750275970ScyDescription 751330567Sgordon.It Cm host 752275970ScyAutokey host name for this host 753330567Sgordon.It Cm ident 754275970ScyAutokey group name for this host 755330567Sgordon.It Cm flags 756275970Scyhost flags (see Autokey specification) 757330567Sgordon.It Cm digest 758275970ScyOpenSSL message digest algorithm 759330567Sgordon.It Cm signature 760275970ScyOpenSSL digest/signature scheme 761330567Sgordon.It Cm update 762275970ScyNTP seconds at last signature update 763330567Sgordon.It Cm cert 764275970Scycertificate subject, issuer and certificate flags 765330567Sgordon.It Cm until 766275970ScyNTP seconds when the certificate expires 767275970Scy.El 768275970Scy.Ss Peer Variables 769275970ScyThe following peer variables appear in the 770330567Sgordon.Ic readlist 771275970Scybillboard for each association. 772275970ScyNot all variables are displayed in some configurations. 773330567Sgordon.Pp 774275970Scy.Bl -tag -width "something" -compact -offset indent 775275970Scy.It Variable 776275970ScyDescription 777330567Sgordon.It Cm associd 778330567Sgordonassociation id 779330567Sgordon.It Cm status 780275970Scy.Lk decode.html#peer "peer status word" 781330567Sgordon.It Cm srcadr 782275970Scysource (remote) IP address 783330567Sgordon.It Cm srcport 784275970Scysource (remote) port 785330567Sgordon.It Cm dstadr 786275970Scydestination (local) IP address 787330567Sgordon.It Cm dstport 788275970Scydestination (local) port 789330567Sgordon.It Cm leap 790275970Scyleap indicator (0\-3) 791330567Sgordon.It Cm stratum 792275970Scystratum (0\-15) 793330567Sgordon.It Cm precision 794275970Scyprecision (log2 s) 795330567Sgordon.It Cm rootdelay 796275970Scytotal roundtrip delay to the primary reference clock 797330567Sgordon.It Cm rootdisp 798275970Scytotal root dispersion to the primary reference clock 799330567Sgordon.It Cm refid 800330567Sgordonreference id or 801275970Scy.Lk decode.html#kiss "kiss code" 802330567Sgordon.It Cm reftime 803275970Scyreference time 804330567Sgordon.It Cm rec 805330567Sgordonlast packet received time 806330567Sgordon.It Cm reach 807275970Scyreach register (octal) 808330567Sgordon.It Cm unreach 809275970Scyunreach counter 810330567Sgordon.It Cm hmode 811275970Scyhost mode (1\-6) 812330567Sgordon.It Cm pmode 813275970Scypeer mode (1\-5) 814330567Sgordon.It Cm hpoll 815275970Scyhost poll exponent (log2 s) (3\-17) 816330567Sgordon.It Cm ppoll 817275970Scypeer poll exponent (log2 s) (3\-17) 818330567Sgordon.It Cm headway 819275970Scyheadway (see 820275970Scy.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" ) 821330567Sgordon.It Cm flash 822275970Scy.Lk decode.html#flash "flash status word" 823330567Sgordon.It Cm keyid 824330567Sgordonsymmetric key id 825330567Sgordon.It Cm offset 826275970Scyfilter offset 827330567Sgordon.It Cm delay 828275970Scyfilter delay 829330567Sgordon.It Cm dispersion 830275970Scyfilter dispersion 831330567Sgordon.It Cm jitter 832275970Scyfilter jitter 833330567Sgordon.It Cm bias 834275970Scyunicast/broadcast bias 835330567Sgordon.It Cm xleave 836275970Scyinterleave delay (see 837275970Scy.Lk xleave.html "NTP Interleaved Modes" ) 838275970Scy.El 839275970ScyThe 840330567Sgordon.Cm bias 841275970Scyvariable is calculated when the first broadcast packet is received 842275970Scyafter the calibration volley. 843330567SgordonIt represents the offset of the broadcast subgraph relative to the 844330567Sgordonunicast subgraph. 845275970ScyThe 846330567Sgordon.Cm xleave 847275970Scyvariable appears only for the interleaved symmetric and interleaved modes. 848275970ScyIt represents the internal queuing, buffering and transmission delays 849275970Scyfor the preceding packet. 850275970Scy.Pp 851275970ScyWhen the NTPv4 daemon is compiled with the OpenSSL software library, 852275970Scyadditional peer variables are displayed, including the following: 853275970Scy.Bl -tag -width "something" -compact -offset indent 854275970Scy.It Variable 855275970ScyDescription 856330567Sgordon.It Cm flags 857275970Scypeer flags (see Autokey specification) 858330567Sgordon.It Cm host 859275970ScyAutokey server name 860330567Sgordon.It Cm flags 861275970Scypeer flags (see Autokey specification) 862330567Sgordon.It Cm signature 863275970ScyOpenSSL digest/signature scheme 864330567Sgordon.It Cm initsequence 865330567Sgordoninitial key id 866330567Sgordon.It Cm initkey 867275970Scyinitial key index 868330567Sgordon.It Cm timestamp 869275970ScyAutokey signature timestamp 870330567Sgordon.It Cm ident 871330567SgordonAutokey group name for this association 872275970Scy.El 873275970Scy.Ss Clock Variables 874275970ScyThe following clock variables appear in the 875330567Sgordon.Ic clocklist 876275970Scybillboard for each association with a reference clock. 877275970ScyNot all variables are displayed in some configurations. 878275970Scy.Bl -tag -width "something" -compact -offset indent 879275970Scy.It Variable 880275970ScyDescription 881330567Sgordon.It Cm associd 882330567Sgordonassociation id 883330567Sgordon.It Cm status 884275970Scy.Lk decode.html#clock "clock status word" 885330567Sgordon.It Cm device 886275970Scydevice description 887330567Sgordon.It Cm timecode 888275970ScyASCII time code string (specific to device) 889330567Sgordon.It Cm poll 890275970Scypoll messages sent 891330567Sgordon.It Cm noreply 892275970Scyno reply 893330567Sgordon.It Cm badformat 894275970Scybad format 895330567Sgordon.It Cm baddata 896275970Scybad date or time 897330567Sgordon.It Cm fudgetime1 898275970Scyfudge time 1 899330567Sgordon.It Cm fudgetime2 900275970Scyfudge time 2 901330567Sgordon.It Cm stratum 902275970Scydriver stratum 903330567Sgordon.It Cm refid 904330567Sgordondriver reference id 905330567Sgordon.It Cm flags 906275970Scydriver flags 907275970Scy.El 908275970Scy.Sh "OPTIONS" 909275970Scy.Bl -tag 910275970Scy.It Fl 4 , Fl \-ipv4 911330567SgordonForce IPv4 name resolution. 912275970ScyThis option must not appear in combination with any of the following options: 913275970Scyipv6. 914275970Scy.sp 915330567SgordonForce resolution of following host names on the command line 916275970Scyto the IPv4 namespace. 917275970Scy.It Fl 6 , Fl \-ipv6 918330567SgordonForce IPv6 name resolution. 919275970ScyThis option must not appear in combination with any of the following options: 920275970Scyipv4. 921275970Scy.sp 922330567SgordonForce resolution of following host names on the command line 923275970Scyto the IPv6 namespace. 924275970Scy.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 925275970Scyrun a command and exit. 926275970ScyThis option may appear an unlimited number of times. 927275970Scy.sp 928275970ScyThe following argument is interpreted as an interactive format command 929275970Scyand is added to the list of commands to be executed on the specified 930275970Scyhost(s). 931275970Scy.It Fl d , Fl \-debug\-level 932275970ScyIncrease debug verbosity level. 933275970ScyThis option may appear an unlimited number of times. 934275970Scy.sp 935275970Scy.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 936275970ScySet the debug verbosity level. 937275970ScyThis option may appear an unlimited number of times. 938275970ScyThis option takes an integer number as its argument. 939275970Scy.sp 940275970Scy.It Fl i , Fl \-interactive 941275970ScyForce ntpq to operate in interactive mode. 942275970ScyThis option must not appear in combination with any of the following options: 943275970Scycommand, peers. 944275970Scy.sp 945275970ScyForce \fBntpq\fP to operate in interactive mode. 946275970ScyPrompts will be written to the standard output and 947275970Scycommands read from the standard input. 948275970Scy.It Fl n , Fl \-numeric 949275970Scynumeric host addresses. 950275970Scy.sp 951275970ScyOutput all host addresses in dotted\-quad numeric format rather than 952330567Sgordonconverting to the canonical host names. 953275970Scy.It Fl \-old\-rv 954275970ScyAlways output status line with readvar. 955275970Scy.sp 956275970ScyBy default, \fBntpq\fP now suppresses the \fBassocid=...\fP 957275970Scyline that precedes the output of \fBreadvar\fP 958275970Scy(alias \fBrv\fP) when a single variable is requested, such as 959275970Scy\fBntpq \-c "rv 0 offset"\fP. 960275970ScyThis option causes \fBntpq\fP to include both lines of output 961275970Scyfor a single\-variable \fBreadvar\fP. 962275970ScyUsing an environment variable to 963275970Scypreset this option in a script will enable both older and 964275970Scynewer \fBntpq\fP to behave identically in this regard. 965275970Scy.It Fl p , Fl \-peers 966275970ScyPrint a list of the peers. 967275970ScyThis option must not appear in combination with any of the following options: 968275970Scyinteractive. 969275970Scy.sp 970275970ScyPrint a list of the peers known to the server as well as a summary 971275970Scyof their state. This is equivalent to the 'peers' interactive command. 972298770Sdelphij.It Fl r Ar keyword , Fl \-refid Ns = Ns Ar keyword 973298770SdelphijSet default display type for S2+ refids. 974298770SdelphijThis option takes a keyword as its argument. The argument sets an enumeration value that can 975298770Sdelphijbe tested by comparing them against the option value macro. 976298770SdelphijThe available keywords are: 977298770Sdelphij.in +4 978298770Sdelphij.nf 979298770Sdelphij.na 980298770Sdelphijhash ipv4 981298770Sdelphij.fi 982298770Sdelphijor their numeric equivalent. 983298770Sdelphij.in -4 984298770Sdelphij.sp 985298770SdelphijThe default 986298770Sdelphij.Ar keyword 987298770Sdelphijfor this option is: 988298770Sdelphij.ti +4 989298770Sdelphij ipv4 990298770Sdelphij.sp 991298770SdelphijSet the default display format for S2+ refids. 992275970Scy.It Fl w , Fl \-wide 993275970ScyDisplay the full 'remote' value. 994275970Scy.sp 995275970ScyDisplay the full value of the 'remote' value. If this requires 996275970Scymore than 15 characters, display the full value, emit a newline, 997275970Scyand continue the data display properly indented on the next line. 998275970Scy.It Fl \&? , Fl \-help 999275970ScyDisplay usage information and exit. 1000275970Scy.It Fl \&! , Fl \-more\-help 1001275970ScyPass the extended usage information through a pager. 1002275970Scy.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc 1003275970ScySave the option state to \fIcfgfile\fP. The default is the \fIlast\fP 1004275970Scyconfiguration file listed in the \fBOPTION PRESETS\fP section, below. 1005275970ScyThe command will exit after updating the config file. 1006275970Scy.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts 1007275970ScyLoad options from \fIcfgfile\fP. 1008275970ScyThe \fIno\-load\-opts\fP form will disable the loading 1009275970Scyof earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early, 1010275970Scyout of order. 1011275970Scy.It Fl \-version Op Brq Ar v|c|n 1012275970ScyOutput version of program and exit. The default mode is `v', a simple 1013275970Scyversion. The `c' mode will print copyright information and `n' will 1014275970Scyprint the full copyright notice. 1015275970Scy.El 1016275970Scy.Sh "OPTION PRESETS" 1017275970ScyAny option that is not marked as \fInot presettable\fP may be preset 1018275970Scyby loading values from configuration ("RC" or ".INI") file(s) and values from 1019275970Scyenvironment variables named: 1020275970Scy.nf 1021275970Scy \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP 1022275970Scy.fi 1023275970Scy.ad 1024275970ScyThe environmental presets take precedence (are processed later than) 1025275970Scythe configuration files. 1026275970ScyThe \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". 1027275970ScyIf any of these are directories, then the file \fI.ntprc\fP 1028275970Scyis searched for within those directories. 1029275970Scy.Sh "ENVIRONMENT" 1030275970ScySee \fBOPTION PRESETS\fP for configuration environment variables. 1031275970Scy.Sh "FILES" 1032275970ScySee \fBOPTION PRESETS\fP for configuration files. 1033275970Scy.Sh "EXIT STATUS" 1034275970ScyOne of the following exit values will be returned: 1035275970Scy.Bl -tag 1036275970Scy.It 0 " (EXIT_SUCCESS)" 1037275970ScySuccessful program execution. 1038275970Scy.It 1 " (EXIT_FAILURE)" 1039275970ScyThe operation failed or the command syntax was not valid. 1040275970Scy.It 66 " (EX_NOINPUT)" 1041275970ScyA specified configuration file could not be loaded. 1042275970Scy.It 70 " (EX_SOFTWARE)" 1043275970Scylibopts had an internal operational error. Please report 1044275970Scyit to autogen\-users@lists.sourceforge.net. Thank you. 1045275970Scy.El 1046275970Scy.Sh "AUTHORS" 1047280849ScyThe University of Delaware and Network Time Foundation 1048275970Scy.Sh "COPYRIGHT" 1049316722SdelphijCopyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. 1050275970ScyThis program is released under the terms of the NTP license, <http://ntp.org/license>. 1051275970Scy.Sh "BUGS" 1052275970ScyPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org 1053275970Scy.Sh "NOTES" 1054275970ScyThis manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP 1055275970Scyoption definitions. 1056