1316722Sdelphij.Dd March 21 2017 2280849Scy.Dt NTPQ 8 User Commands 3280849Scy.Os 4280849Scy.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) 555857Ssheldonh.\" 655857Ssheldonh.\" $FreeBSD: releng/11.0/usr.sbin/ntp/doc/ntpq.8 316722 2017-04-12 06:24:35Z delphij $ 755857Ssheldonh.\" 8316722Sdelphij.\" It has been AutoGen-ed March 21, 2017 at 10:45:31 AM by AutoGen 5.18.5 9280849Scy.\" From the definitions ntpq-opts.def 10280849Scy.\" and the template file agmdoc-cmd.tpl 1155857Ssheldonh.Sh NAME 1255857Ssheldonh.Nm ntpq 1355857Ssheldonh.Nd standard NTP query program 1455857Ssheldonh.Sh SYNOPSIS 1555857Ssheldonh.Nm 16280849Scy.\" Mixture of short (flag) options and long options 17280849Scy.Op Fl flags 18280849Scy.Op Fl flag Op Ar value 19280849Scy.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc 20280849Scy[ host ...] 21280849Scy.Pp 2255857Ssheldonh.Sh DESCRIPTION 2382501SsheldonhThe 2455857Ssheldonh.Nm 25280849Scyutility program is used to query NTP servers which 26280849Scyimplement the standard NTP mode 6 control message formats defined 27280849Scyin Appendix B of the NTPv3 specification RFC1305, requesting 28280849Scyinformation about current state and/or changes in that state. 29280849ScyThe same formats are used in NTPv4, although some of the 30280849Scyvariables have changed and new ones added. The description on this 31280849Scypage is for the NTPv4 variables. 32280849ScyThe program may be run either in interactive mode or controlled using 33280849Scycommand line arguments. 34280849ScyRequests to read and write arbitrary 35280849Scyvariables can be assembled, with raw and pretty\-printed output 36280849Scyoptions being available. 3782501SsheldonhThe 3855857Ssheldonh.Nm 39280849Scyutility can also obtain and print a 40280849Scylist of peers in a common format by sending multiple queries to the 41280849Scyserver. 4282501SsheldonhIf one or more request options is included on the command line 4382501Ssheldonhwhen 4455857Ssheldonh.Nm 4582501Ssheldonhis executed, each of the requests will be sent 4682501Ssheldonhto the NTP servers running on each of the hosts given as command 4782501Ssheldonhline arguments, or on localhost by default. 4882501SsheldonhIf no request options 4982501Ssheldonhare given, 5055857Ssheldonh.Nm 5182501Ssheldonhwill attempt to read commands from the 5282501Ssheldonhstandard input and execute these on the NTP server running on the 5382501Ssheldonhfirst host given on the command line, again defaulting to localhost 5455857Ssheldonhwhen no other host is specified. 5599968ScharnierThe 5655857Ssheldonh.Nm 5799968Scharnierutility will prompt for 5882501Ssheldonhcommands if the standard input is a terminal device. 5955857Ssheldonh.Nm 60280849Scyuses NTP mode 6 packets to communicate with the 6182501SsheldonhNTP server, and hence can be used to query any compatible server on 6282501Ssheldonhthe network which permits it. 6382501SsheldonhNote that since NTP is a UDP protocol 6482501Ssheldonhthis communication will be somewhat unreliable, especially over 6582501Ssheldonhlarge distances in terms of network topology. 6699968ScharnierThe 6755857Ssheldonh.Nm 6899968Scharnierutility makes 6982501Ssheldonhone attempt to retransmit requests, and will time requests out if 7082501Ssheldonhthe remote host is not heard from within a suitable timeout 7182501Ssheldonhtime. 7282501SsheldonhSpecifying a 7382501Ssheldonhcommand line option other than 7482501Ssheldonh.Fl i 7582501Ssheldonhor 7682501Ssheldonh.Fl n 7782501Ssheldonhwill 7882501Ssheldonhcause the specified query (queries) to be sent to the indicated 7982501Ssheldonhhost(s) immediately. 8082501SsheldonhOtherwise, 8182501Ssheldonh.Nm 8282501Ssheldonhwill attempt to read 8382501Ssheldonhinteractive format commands from the standard input. 8482501Ssheldonh.Ss "Internal Commands" 8582501SsheldonhInteractive format commands consist of a keyword followed by zero 8682501Ssheldonhto four arguments. 8782501SsheldonhOnly enough characters of the full keyword to 8882501Ssheldonhuniquely identify the command need be typed. 8982501SsheldonhA 9082501Ssheldonhnumber of interactive format commands are executed entirely within 9182501Ssheldonhthe 9255857Ssheldonh.Nm 9399968Scharnierutility itself and do not result in NTP mode 6 9482501Ssheldonhrequests being sent to a server. 9555857SsheldonhThese are described following. 96280849Scy.Bl -tag -width "? [command_keyword]" -compact -offset indent 97280849Scy.It Ic ? Op Ar command_keyword 9855857Ssheldonh.It Ic help Op Ar command_keyword 9955857SsheldonhA 100280849Scy.Ql \&? 10182501Ssheldonhby itself will print a list of all the command 10282501Ssheldonhkeywords known to this incarnation of 10368965Sru.Nm . 10455857SsheldonhA 105280849Scy.Ql \&? 10682501Ssheldonhfollowed by a command keyword will print function and usage 10782501Ssheldonhinformation about the command. 10855857SsheldonhThis command is probably a better 10955857Ssheldonhsource of information about 11055857Ssheldonh.Nm 11182501Ssheldonhthan this manual 11282501Ssheldonhpage. 113280849Scy.It Ic addvars Ar variable_name Ns Xo Op Ic =value 114280849Scy.Ic ... 11555857Ssheldonh.Xc 116280849Scy.It Ic rmvars Ar variable_name Ic ... 11755857Ssheldonh.It Ic clearvars 118280849Scy.It Ic showvars 11982501SsheldonhThe data carried by NTP mode 6 messages consists of a list of 12082501Ssheldonhitems of the form 12182501Ssheldonh.Ql variable_name=value , 12255857Ssheldonhwhere the 12382501Ssheldonh.Ql =value 12482501Ssheldonhis ignored, and can be omitted, 12582501Ssheldonhin requests to the server to read variables. 12699968ScharnierThe 12755857Ssheldonh.Nm 12899968Scharnierutility maintains an internal list in which data to be included in control 12955857Ssheldonhmessages can be assembled, and sent using the 13055857Ssheldonh.Ic readlist 13155857Ssheldonhand 13255857Ssheldonh.Ic writelist 13357673Ssheldonhcommands described below. 13457673SsheldonhThe 13555857Ssheldonh.Ic addvars 13682501Ssheldonhcommand allows variables and their optional values to be added to 13782501Ssheldonhthe list. 13882501SsheldonhIf more than one variable is to be added, the list should 139280849Scybe comma\-separated and not contain white space. 14055857SsheldonhThe 14155857Ssheldonh.Ic rmvars 14282501Ssheldonhcommand can be used to remove individual variables from the list, 14382501Ssheldonhwhile the 144107311Sru.Ic clearlist 14582501Ssheldonhcommand removes all variables from the 14682501Ssheldonhlist. 147280849ScyThe 148280849Scy.Ic showvars 149280849Scycommand displays the current list of optional variables. 150280849Scy.It Ic authenticate Op yes | no 151280849ScyNormally 152280849Scy.Nm 153280849Scydoes not authenticate requests unless 154280849Scythey are write requests. 155280849ScyThe command 156280849Scy.Ql authenticate yes 157280849Scycauses 158280849Scy.Nm 159280849Scyto send authentication with all requests it 160280849Scymakes. 161280849ScyAuthenticated requests causes some servers to handle 162280849Scyrequests slightly differently, and can occasionally melt the CPU in 163280849Scyfuzzballs if you turn authentication on before doing a 164280849Scy.Ic peer 165280849Scydisplay. 166280849ScyThe command 167280849Scy.Ql authenticate 168280849Scycauses 169280849Scy.Nm 170280849Scyto display whether or not 171280849Scy.Nm 172280849Scyis currently autheinticating requests. 17355857Ssheldonh.It Ic cooked 17482501SsheldonhCauses output from query commands to be "cooked", so that 17582501Ssheldonhvariables which are recognized by 17682501Ssheldonh.Nm 17782501Ssheldonhwill have their 17882501Ssheldonhvalues reformatted for human consumption. 17955857SsheldonhVariables which 18055857Ssheldonh.Nm 181280849Scythinks should have a decodable value but didn't are 18282501Ssheldonhmarked with a trailing 183131531Sru.Ql \&? . 184280849Scy.It Xo 185280849Scy.Ic debug 186280849Scy.Oo 18782501Ssheldonh.Cm more | 18882501Ssheldonh.Cm less | 18982501Ssheldonh.Cm off 190280849Scy.Oc 19160588Ssheldonh.Xc 192280849ScyWith no argument, displays the current debug level. 193280849ScyOtherwise, the debug level is changed to the indicated level. 19455857Ssheldonh.It Ic delay Ar milliseconds 19582501SsheldonhSpecify a time interval to be added to timestamps included in 19682501Ssheldonhrequests which require authentication. 19782501SsheldonhThis is used to enable 19882501Ssheldonh(unreliable) server reconfiguration over long delay network paths 19982501Ssheldonhor between machines whose clocks are unsynchronized. 20082501SsheldonhActually the 20182501Ssheldonhserver does not now require timestamps in authenticated requests, 20255857Ssheldonhso this command may be obsolete. 203280849Scy.It Ic exit 204280849ScyExit 205280849Scy.Nm . 20655857Ssheldonh.It Ic host Ar hostname 20755857SsheldonhSet the host to which future queries will be sent. 208280849Scy.Ar hostname 209280849Scymay be either a host name or a numeric address. 210280849Scy.It Ic hostnames Op Cm yes | Cm no 21155857SsheldonhIf 21282501Ssheldonh.Cm yes 21382501Ssheldonhis specified, host names are printed in 21482501Ssheldonhinformation displays. 21555857SsheldonhIf 21682501Ssheldonh.Cm no 21782501Ssheldonhis specified, numeric 21882501Ssheldonhaddresses are printed instead. 21955857SsheldonhThe default is 22082501Ssheldonh.Cm yes , 22182501Ssheldonhunless 22282501Ssheldonhmodified using the command line 22355857Ssheldonh.Fl n 22455857Ssheldonhswitch. 22555857Ssheldonh.It Ic keyid Ar keyid 226280849ScyThis command allows the specification of a key number to be 227280849Scyused to authenticate configuration requests. 228280849ScyThis must correspond 229289764Sglebiusto the 230289764Sglebius.Cm controlkey 231289764Sglebiuskey number the server has been configured to use for this 232280849Scypurpose. 233280849Scy.It Ic keytype Xo Oo 234280849Scy.Cm md5 | 235280849Scy.Cm OpenSSLDigestType 236280849Scy.Oc 237280849Scy.Xc 238280849ScySpecify the type of key to use for authenticating requests. 239280849Scy.Cm md5 240280849Scyis alway supported. 241280849ScyIf 242280849Scy.Nm 243280849Scywas built with OpenSSL support, 244280849Scyany digest type supported by OpenSSL can also be provided. 245280849ScyIf no argument is given, the current 246280849Scy.Ic keytype 247280849Scyis displayed. 248280849Scy.It Ic ntpversion Xo Oo 24982501Ssheldonh.Cm 1 | 25082501Ssheldonh.Cm 2 | 25182501Ssheldonh.Cm 3 | 25282501Ssheldonh.Cm 4 253280849Scy.Oc 25460588Ssheldonh.Xc 25582501SsheldonhSets the NTP version number which 25655857Ssheldonh.Nm 25782501Ssheldonhclaims in 25882501Ssheldonhpackets. 259280849ScyDefaults to 3, and note that mode 6 control messages (and 260280849Scymodes, for that matter) didn't exist in NTP version 1. 26182501SsheldonhThere appear 26282501Ssheldonhto be no servers left which demand version 1. 263280849ScyWith no argument, displays the current NTP version that will be used 264280849Scywhen communicating with servers. 265158688Spav.It Ic passwd 266280849ScyThis command prompts you to type in a password (which will not 267280849Scybe echoed) which will be used to authenticate configuration 268280849Scyrequests. 269280849ScyThe password must correspond to the key configured for 270280849Scyuse by the NTP server for this purpose if such requests are to be 271280849Scysuccessful. 272280849Scy.\" Not yet implemented. 273280849Scy.\" .It Ic poll 274280849Scy.\" .Op Ar n 275280849Scy.\" .Op Ic verbose 276280849Scy.\" Poll an NTP server in client mode 277280849Scy.\" .Ar n 278280849Scy.\" times. 27955857Ssheldonh.It Ic quit 28055857SsheldonhExit 28168965Sru.Nm . 28255857Ssheldonh.It Ic raw 28382501SsheldonhCauses all output from query commands is printed as received 28482501Ssheldonhfrom the remote server. 285280849ScyThe only formating/interpretation done on 28682501Ssheldonhthe data is to transform nonascii data into a printable (but barely 28782501Ssheldonhunderstandable) form. 28855857Ssheldonh.It Ic timeout Ar milliseconds 28957673SsheldonhSpecify a timeout period for responses to server queries. 29082501SsheldonhThe 29182501Ssheldonhdefault is about 5000 milliseconds. 29255857SsheldonhNote that since 29355857Ssheldonh.Nm 29482501Ssheldonhretries each query once after a timeout, the total waiting time for 29582501Ssheldonha timeout will be twice the timeout value set. 296280849Scy.It Ic version 297280849ScyPrint the version of the 298280849Scy.Nm 299280849Scyprogram. 30055857Ssheldonh.El 301280849Scy.Ss "Control Message Commands" 302280849ScyAssociation IDs are used to identify system, peer and clock variables. 303280849ScySystem variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace. 304280849ScyMost control commands send a single mode\-6 message to the server and expect a single response message. 305280849ScyThe exceptions are the 306280849Scy.Li peers 307280849Scycommand, which sends a series of messages, 308280849Scyand the 309280849Scy.Li mreadlist 310280849Scyand 311280849Scy.Li mreadvar 312280849Scycommands, which iterate over a range of associations. 313280849Scy.Bl -tag -width "something" -compact -offset indent 314280849Scy.It Cm associations 315280849ScyDisplay a list of mobilized associations in the form: 316280849Scy.Dl ind assid status conf reach auth condition last_event cnt 317280849Scy.Bl -column -offset indent ".Sy Variable" ".Sy Description" 318280849Scy.It Sy String Ta Sy Description 319280849Scy.It Li ind Ta index on this list 320280849Scy.It Li assid Ta association ID 321280849Scy.It Li status Ta peer status word 322280849Scy.It Li conf Ta Li yes : persistent, Li no : ephemeral 323280849Scy.It Li reach Ta Li yes : reachable, Li no : unreachable 324280849Scy.It Li auth Ta Li ok , Li yes , Li bad and Li none 325280849Scy.It Li condition Ta selection status (see the Li select field of the peer status word) 326280849Scy.It Li last_event Ta event report (see the Li event field of the peer status word) 327280849Scy.It Li cnt Ta event count (see the Li count field of the peer status word) 328280849Scy.El 329280849Scy.It Cm authinfo 330280849ScyDisplay the authentication statistics. 331280849Scy.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ... 332280849Scy.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ... 333280849ScyDisplay a list of clock variables for those associations supporting a reference clock. 334280849Scy.It Cm :config Op ... 335280849ScySend 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. 336280849Scy.It Cm config\-from\-file Ar filename 337280849ScySend the each line of 338280849Scy.Ar filename 339280849Scyto 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. 340280849Scy.It Ic ifstats 341280849ScyDisplay statistics for each local network address. Authentication is required. 342280849Scy.It Ic iostats 343280849ScyDisplay network and reference clock I/O statistics. 344280849Scy.It Ic kerninfo 345280849ScyDisplay 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. 346280849Scy.It Ic lassociations 347280849ScyPerform the same function as the associations command, except display mobilized and unmobilized associations. 348280849Scy.It Ic lopeers Xo 349280849Scy.Oo Ic \-4 | 350280849Scy.Ic \-6 35182501Ssheldonh.Oc 35255857Ssheldonh.Xc 353280849ScyObtain and print a list of all peers and clients showing 354280849Scy.Ar dstadr 355280849Scy(associated with any given IP version). 356280849Scy.It Ic lpeers Xo 357280849Scy.Oo Ic \-4 | 358280849Scy.Ic \-6 35982501Ssheldonh.Oc 36055857Ssheldonh.Xc 361280849ScyPrint a peer spreadsheet for the appropriate IP version(s). 362280849Scy.Ar dstadr 363280849Scy(associated with any given IP version). 364280849Scy.It Ic monstats 365280849ScyDisplay monitor facility statistics. 366280849Scy.It Ic mrulist Oo Ic limited | Ic kod | Ic mincount Ns = Ns Ar count | Ic laddr Ns = Ns Ar localaddr | Ic sort Ns = Ns Ar sortorder | Ic resany Ns = Ns Ar hexmask | Ic resall Ns = Ns Ar hexmask Oc 367280849ScyObtain and print traffic counts collected and maintained by the monitor facility. 368280849ScyWith the exception of 369280849Scy.Cm sort Ns = Ns Ar sortorder , 370280849Scythe options filter the list returned by 371280849Scy.Cm ntpd. 372280849ScyThe 373280849Scy.Cm limited 374280849Scyand 375280849Scy.Cm kod 376280849Scyoptions return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response. 377280849ScyThe 378280849Scy.Cm mincount Ns = Ns Ar count 379280849Scyoption filters entries representing less than 380280849Scy.Ar count 381280849Scypackets. 382280849ScyThe 383280849Scy.Cm laddr Ns = Ns Ar localaddr 384280849Scyoption filters entries for packets received on any local address other than 385280849Scy.Ar localaddr . 386280849Scy.Cm resany Ns = Ns Ar hexmask 387280849Scyand 388280849Scy.Cm resall Ns = Ns Ar hexmask 389280849Scyfilter entries containing none or less than all, respectively, of the bits in 390280849Scy.Ar hexmask , 391280849Scywhich must begin with 392280849Scy.Cm 0x . 393280849ScyThe 394280849Scy.Ar sortorder 395280849Scydefaults to 396280849Scy.Cm lstint 397280849Scyand may be any of 398280849Scy.Cm addr , 399280849Scy.Cm count , 400280849Scy.Cm avgint , 401280849Scy.Cm lstint , 402280849Scyor any of those preceded by a minus sign (hyphen) to reverse the sort order. 403280849ScyThe output columns are: 404280849Scy.Bl -tag -width "something" -compact -offset indent 405280849Scy.It Column 406280849ScyDescription 407280849Scy.It Ic lstint 408280849ScyInterval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by 409280849Scy.Nm . 410280849Scy.It Ic avgint 411280849ScyAverage interval in s between packets from this address. 412280849Scy.It Ic rstr 413280849ScyRestriction flags associated with this address. 414280849ScyMost are copied unchanged from the matching 415280849Scy.Ic restrict 416280849Scycommand, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response. 417280849Scy.It Ic r 418280849ScyRate control indicator, either 419280849Scya period, 420280849Scy.Ic L 421280849Scyor 422280849Scy.Ic K 423280849Scyfor no rate control response, 424280849Scyrate limiting by discarding, or rate limiting with a KoD response, respectively. 425280849Scy.It Ic m 426280849ScyPacket mode. 427280849Scy.It Ic v 428280849ScyPacket version number. 429280849Scy.It Ic count 430280849ScyPackets received from this address. 431280849Scy.It Ic rport 432280849ScySource port of last packet from this address. 433280849Scy.It Ic remote address 434280849ScyDNS name, numeric address, or address followed by 435280849Scyclaimed DNS name which could not be verified in parentheses. 436280849Scy.El 437280849Scy.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ... 438280849Scy.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ... 439280849ScyPerform the same function as the 440280849Scy.Ic readvar 441280849Scycommand, except for a range of association IDs. 442280849ScyThis range is determined from the association list cached by the most recent 44355857Ssheldonh.Ic associations 44455857Ssheldonhcommand. 445280849Scy.It Ic opeers Xo 446280849Scy.Oo Ic \-4 | 447280849Scy.Ic \-6 44882501Ssheldonh.Oc 44955857Ssheldonh.Xc 450280849ScyObtain and print the old\-style list of all peers and clients showing 451280849Scy.Ar dstadr 452280849Scy(associated with any given IP version), 453280849Scyrather than the 454280849Scy.Ar refid . 45589625Sroberto.It Ic passociations 456280849ScyPerform the same function as the 45755857Ssheldonh.Ic associations 458280849Scycommand, 459280849Scyexcept that it uses previously stored data rather than making a new query. 46055857Ssheldonh.It Ic peers 461280849ScyDisplay a list of peers in the form: 462280849Scy.Dl [tally]remote refid st t when pool reach delay offset jitter 463280849Scy.Bl -tag -width "something" -compact -offset indent 464280849Scy.It Variable 465280849ScyDescription 466280849Scy.It Ic [tally] 467280849Scysingle\-character code indicating current value of the 468280849Scy.Ic select 469280849Scyfield of the 470280849Scy.Lk decode.html#peer "peer status word" 471280849Scy.It Ic remote 472280849Scyhost name (or IP number) of peer. 473280849ScyThe value displayed will be truncated to 15 characters unless the 474280849Scy.Fl w 475280849Scyflag is given, in which case the full value will be displayed 476280849Scyon the first line, 477280849Scyand the remaining data is displayed on the next line. 478280849Scy.It Ic refid 479280849Scyassociation ID or 480280849Scy.Lk decode.html#kiss "'kiss code" 481280849Scy.It Ic st 482280849Scystratum 483280849Scy.It Ic t 484280849Scy.Ic u : 485280849Scyunicast or manycast client, 486280849Scy.Ic b : 487280849Scybroadcast or multicast client, 488280849Scy.Ic l : 489280849Scylocal (reference clock), 490280849Scy.Ic s : 491280849Scysymmetric (peer), 492280849Scy.Ic A : 493280849Scymanycast server, 494280849Scy.Ic B : 495280849Scybroadcast server, 496280849Scy.Ic M : 497280849Scymulticast server 498280849Scy.It Ic when 499280849Scysec/min/hr since last received packet 500280849Scy.It Ic poll 501280849Scypoll interval (log2 s) 502280849Scy.It Ic reach 503280849Scyreach shift register (octal) 504280849Scy.It Ic delay 505280849Scyroundtrip delay 506280849Scy.It Ic offset 507280849Scyoffset of server relative to this host 508280849Scy.It Ic jitter 509280849Scyjitter 510280849Scy.El 511289764Sglebius.It Ic apeers 512289764SglebiusDisplay a list of peers in the form: 513289764Sglebius.Dl [tally]remote refid assid st t when pool reach delay offset jitter 514289764Sglebiuswhere the output is just like the 515289764Sglebius.Ic peers 516289764Sglebiuscommand except that the 517289764Sglebius.Ic refid 518289764Sglebiusis displayed in hex format and the association number is also displayed. 519280849Scy.It Ic pstats Ar assocID 520280849ScyShow the statistics for the peer with the given 521280849Scy.Ar assocID . 522158688Spav.It Ic readlist Ar assocID 523158688Spav.It Ic rl Ar assocID 524280849ScyRead the system or peer variables included in the variable list. 525280849Scy.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc 526280849Scy.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc 527280849ScyDisplay the specified variables. 528280849ScyIf 529280849Scy.Ar assocID 530280849Scyis zero, the variables are from the 531280849Scy.Sx System Variables 532280849Scyname space, otherwise they are from the 533280849Scy.Sx Peer Variables 534280849Scyname space. 535280849ScyThe 536280849Scy.Ar assocID 537280849Scyis required, as the same name can occur in both spaces. 538280849ScyIf no 539280849Scy.Ar name 540280849Scyis included, all operative variables in the name space are displayed. 541280849ScyIn this case only, if the 542280849Scy.Ar assocID 543280849Scyis omitted, it is assumed zero. 544280849ScyMultiple names are specified with comma separators and without whitespace. 545280849ScyNote that time values are represented in milliseconds 546280849Scyand frequency values in parts\-per\-million (PPM). 547280849ScySome NTP timestamps are represented in the format 548280849ScyYYYYMMDDTTTT , 549280849Scywhere YYYY is the year, 550280849ScyMM the month of year, 551280849ScyDD the day of month and 552280849ScyTTTT the time of day. 553280849Scy.It Ic reslist 554280849ScyShow the access control (restrict) list for 555280849Scy.Nm . 556280849Scy.It Ic saveconfig Ar filename 557280849ScyWrite the current configuration, 558280849Scyincluding any runtime modifications given with 559280849Scy.Ic :config 560280849Scyor 561280849Scy.Ic config\-from\-file , 562280849Scyto the ntpd host's file 563280849Scy.Ar filename . 564280849ScyThis command will be rejected by the server unless 565280849Scy.Lk miscopt.html#saveconfigdir "saveconfigdir" 566280849Scyappears in the 567280849Scy.Ic ntpd 568280849Scyconfiguration file. 569280849Scy.Ar filename 570280849Scycan use 571280849Scy.Xr strftime 572280849Scyformat specifies to substitute the current date and time, for example, 573280849Scy.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] . 574280849ScyThe filename used is stored in system variable 575280849Scy.Ic savedconfig . 576280849ScyAuthentication is required. 577280849Scy.It Ic timerstats 578280849ScyDisplay interval timer counters. 579280849Scy.It Ic writelist Ar assocID 580280849ScyWrite the system or peer variables included in the variable list. 581280849Scy.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ... 582280849ScyWrite the specified variables. 583158688SpavIf the 584280849Scy.Ar assocID 585280849Scyis zero, the variables are from the 586280849Scy.Sx System Variables 587280849Scyname space, otherwise they are from the 588280849Scy.Sx Peer Variables 589280849Scyname space. 590162806SruThe 591280849Scy.Ar assocID 592280849Scyis required, as the same name can occur in both spaces. 593280849Scy.It Ic sysinfo 594280849ScyDisplay operational summary. 595280849Scy.It Ic sysstats 596280849ScyPrint statistics counters maintained in the protocol module. 597158688Spav.El 598280849Scy.Ss Status Words and Kiss Codes 599280849ScyThe current state of the operating program is shown 600280849Scyin a set of status words 601280849Scymaintained by the system. 602280849ScyStatus information is also available on a per\-association basis. 603280849ScyThese words are displayed in the 60455857Ssheldonh.Ic rv 605280849Scyand 606280849Scy.Ic as 607280849Scycommands both in hexadecimal and in decoded short tip strings. 608280849ScyThe codes, tips and short explanations are documented on the 609280849Scy.Lk decode.html "Event Messages and Status Words" 610280849Scypage. 611280849ScyThe page also includes a list of system and peer messages, 612280849Scythe code for the latest of which is included in the status word. 613280849Scy.Pp 614280849ScyInformation resulting from protocol machine state transitions 615280849Scyis displayed using an informal set of ASCII strings called 616280849Scy.Lk decode.html#kiss "kiss codes" . 617280849ScyThe original purpose was for kiss\-o'\-death (KoD) packets 618280849Scysent by the server to advise the client of an unusual condition. 619280849ScyThey are now displayed, when appropriate, 620280849Scyin the reference identifier field in various billboards. 621158688Spav.Ss System Variables 622280849ScyThe following system variables appear in the 623280849Scy.Ic rv 624280849Scybillboard. 625280849ScyNot all variables are displayed in some configurations. 626280849Scy.Bl -tag -width "something" -compact -offset indent 627280849Scy.It Variable 628280849ScyDescription 629280849Scy.It Ic status 630280849Scy.Lk decode.html#sys "system status word" 631280849Scy.It Ic version 632280849ScyNTP software version and build time 633280849Scy.It Ic processor 634280849Scyhardware platform and version 635280849Scy.It Ic system 636280849Scyoperating system and version 637280849Scy.It Ic leap 638280849Scyleap warning indicator (0\-3) 639280849Scy.It Ic stratum 640280849Scystratum (1\-15) 641280849Scy.It Ic precision 642280849Scyprecision (log2 s) 643280849Scy.It Ic rootdelay 644280849Scytotal roundtrip delay to the primary reference clock 645280849Scy.It Ic rootdisp 646280849Scytotal dispersion to the primary reference clock 647280849Scy.It Ic peer 648280849Scysystem peer association ID 649280849Scy.It Ic tc 650280849Scytime constant and poll exponent (log2 s) (3\-17) 651280849Scy.It Ic mintc 652280849Scyminimum time constant (log2 s) (3\-10) 653280849Scy.It Ic clock 654280849Scydate and time of day 655280849Scy.It Ic refid 656280849Scyreference ID or 657280849Scy.Lk decode.html#kiss "kiss code" 658280849Scy.It Ic reftime 659280849Scyreference time 660280849Scy.It Ic offset 661280849Scycombined offset of server relative to this host 662280849Scy.It Ic sys_jitter 663280849Scycombined system jitter 664280849Scy.It Ic frequency 665280849Scyfrequency offset (PPM) relative to hardware clock 666280849Scy.It Ic clk_wander 667280849Scyclock frequency wander (PPM) 668280849Scy.It Ic clk_jitter 669280849Scyclock jitter 670280849Scy.It Ic tai 671280849ScyTAI\-UTC offset (s) 672280849Scy.It Ic leapsec 673280849ScyNTP seconds when the next leap second is/was inserted 674280849Scy.It Ic expire 675280849ScyNTP seconds when the NIST leapseconds file expires 67682501Ssheldonh.El 677280849ScyThe jitter and wander statistics are exponentially\-weighted RMS averages. 678280849ScyThe system jitter is defined in the NTPv4 specification; 679280849Scythe clock jitter statistic is computed by the clock discipline module. 68055857Ssheldonh.Pp 681280849ScyWhen the NTPv4 daemon is compiled with the OpenSSL software library, 682280849Scyadditional system variables are displayed, 683280849Scyincluding some or all of the following, 684280849Scydepending on the particular Autokey dance: 685280849Scy.Bl -tag -width "something" -compact -offset indent 686280849Scy.It Variable 687280849ScyDescription 688280849Scy.It Ic host 689280849ScyAutokey host name for this host 690280849Scy.It Ic ident 691280849ScyAutokey group name for this host 692280849Scy.It Ic flags 693280849Scyhost flags (see Autokey specification) 694280849Scy.It Ic digest 695280849ScyOpenSSL message digest algorithm 696280849Scy.It Ic signature 697280849ScyOpenSSL digest/signature scheme 698280849Scy.It Ic update 699280849ScyNTP seconds at last signature update 700280849Scy.It Ic cert 701280849Scycertificate subject, issuer and certificate flags 702280849Scy.It Ic until 703280849ScyNTP seconds when the certificate expires 704158688Spav.El 705158688Spav.Ss Peer Variables 706280849ScyThe following peer variables appear in the 707280849Scy.Ic rv 708280849Scybillboard for each association. 709280849ScyNot all variables are displayed in some configurations. 710280849Scy.Bl -tag -width "something" -compact -offset indent 711280849Scy.It Variable 712280849ScyDescription 713280849Scy.It Ic associd 714280849Scyassociation ID 715280849Scy.It Ic status 716280849Scy.Lk decode.html#peer "peer status word" 717280849Scy.It Ic srcadr 718280849Scysource (remote) IP address 719280849Scy.It Ic srcport 720280849Scysource (remote) port 721280849Scy.It Ic dstadr 722280849Scydestination (local) IP address 723280849Scy.It Ic dstport 724280849Scydestination (local) port 725280849Scy.It Ic leap 726280849Scyleap indicator (0\-3) 727280849Scy.It Ic stratum 728280849Scystratum (0\-15) 729280849Scy.It Ic precision 730280849Scyprecision (log2 s) 731280849Scy.It Ic rootdelay 732280849Scytotal roundtrip delay to the primary reference clock 733280849Scy.It Ic rootdisp 734280849Scytotal root dispersion to the primary reference clock 735280849Scy.It Ic refid 736280849Scyreference ID or 737280849Scy.Lk decode.html#kiss "kiss code" 738280849Scy.It Ic reftime 739280849Scyreference time 740280849Scy.It Ic reach 741280849Scyreach register (octal) 742280849Scy.It Ic unreach 743280849Scyunreach counter 744280849Scy.It Ic hmode 745280849Scyhost mode (1\-6) 746280849Scy.It Ic pmode 747280849Scypeer mode (1\-5) 748280849Scy.It Ic hpoll 749280849Scyhost poll exponent (log2 s) (3\-17) 750280849Scy.It Ic ppoll 751280849Scypeer poll exponent (log2 s) (3\-17) 752280849Scy.It Ic headway 753280849Scyheadway (see 754280849Scy.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" ) 755280849Scy.It Ic flash 756280849Scy.Lk decode.html#flash "flash status word" 757280849Scy.It Ic offset 758280849Scyfilter offset 759280849Scy.It Ic delay 760280849Scyfilter delay 761280849Scy.It Ic dispersion 762280849Scyfilter dispersion 763280849Scy.It Ic jitter 764280849Scyfilter jitter 765280849Scy.It Ic ident 766280849ScyAutokey group name for this association 767280849Scy.It Ic bias 768280849Scyunicast/broadcast bias 769280849Scy.It Ic xleave 770280849Scyinterleave delay (see 771280849Scy.Lk xleave.html "NTP Interleaved Modes" ) 772158688Spav.El 773158688SpavThe 774280849Scy.Ic bias 775280849Scyvariable is calculated when the first broadcast packet is received 776280849Scyafter the calibration volley. 777280849ScyIt represents the offset of the broadcast subgraph relative to the unicast subgraph. 778162806SruThe 779280849Scy.Ic xleave 780280849Scyvariable appears only for the interleaved symmetric and interleaved modes. 781280849ScyIt represents the internal queuing, buffering and transmission delays 782280849Scyfor the preceding packet. 78355857Ssheldonh.Pp 784280849ScyWhen the NTPv4 daemon is compiled with the OpenSSL software library, 785280849Scyadditional peer variables are displayed, including the following: 786280849Scy.Bl -tag -width "something" -compact -offset indent 787280849Scy.It Variable 788280849ScyDescription 789280849Scy.It Ic flags 790280849Scypeer flags (see Autokey specification) 791280849Scy.It Ic host 792280849ScyAutokey server name 793280849Scy.It Ic flags 794280849Scypeer flags (see Autokey specification) 795280849Scy.It Ic signature 796280849ScyOpenSSL digest/signature scheme 797280849Scy.It Ic initsequence 798280849Scyinitial key ID 799280849Scy.It Ic initkey 800280849Scyinitial key index 801280849Scy.It Ic timestamp 802280849ScyAutokey signature timestamp 80355857Ssheldonh.El 804280849Scy.Ss Clock Variables 805280849ScyThe following clock variables appear in the 806280849Scy.Ic cv 807280849Scybillboard for each association with a reference clock. 808280849ScyNot all variables are displayed in some configurations. 809280849Scy.Bl -tag -width "something" -compact -offset indent 810280849Scy.It Variable 811280849ScyDescription 812280849Scy.It Ic associd 813280849Scyassociation ID 814280849Scy.It Ic status 815280849Scy.Lk decode.html#clock "clock status word" 816280849Scy.It Ic device 817280849Scydevice description 818280849Scy.It Ic timecode 819280849ScyASCII time code string (specific to device) 820280849Scy.It Ic poll 821280849Scypoll messages sent 822280849Scy.It Ic noreply 823280849Scyno reply 824280849Scy.It Ic badformat 825280849Scybad format 826280849Scy.It Ic baddata 827280849Scybad date or time 828280849Scy.It Ic fudgetime1 829280849Scyfudge time 1 830280849Scy.It Ic fudgetime2 831280849Scyfudge time 2 832280849Scy.It Ic stratum 833280849Scydriver stratum 834280849Scy.It Ic refid 835280849Scydriver reference ID 836280849Scy.It Ic flags 837280849Scydriver flags 838280849Scy.El 839280849Scy.Sh "OPTIONS" 840280849Scy.Bl -tag 841280849Scy.It Fl 4 , Fl \-ipv4 842280849ScyForce IPv4 DNS name resolution. 843280849ScyThis option must not appear in combination with any of the following options: 844280849Scyipv6. 845280849Scy.sp 846280849ScyForce DNS resolution of following host names on the command line 847280849Scyto the IPv4 namespace. 848280849Scy.It Fl 6 , Fl \-ipv6 849280849ScyForce IPv6 DNS name resolution. 850280849ScyThis option must not appear in combination with any of the following options: 851280849Scyipv4. 852280849Scy.sp 853280849ScyForce DNS resolution of following host names on the command line 854280849Scyto the IPv6 namespace. 855280849Scy.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 856280849Scyrun a command and exit. 857280849ScyThis option may appear an unlimited number of times. 858280849Scy.sp 859280849ScyThe following argument is interpreted as an interactive format command 860280849Scyand is added to the list of commands to be executed on the specified 861280849Scyhost(s). 862280849Scy.It Fl d , Fl \-debug\-level 863280849ScyIncrease debug verbosity level. 864280849ScyThis option may appear an unlimited number of times. 865280849Scy.sp 866280849Scy.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 867280849ScySet the debug verbosity level. 868280849ScyThis option may appear an unlimited number of times. 869280849ScyThis option takes an integer number as its argument. 870280849Scy.sp 871280849Scy.It Fl i , Fl \-interactive 872280849ScyForce ntpq to operate in interactive mode. 873280849ScyThis option must not appear in combination with any of the following options: 874280849Scycommand, peers. 875280849Scy.sp 876280849ScyForce \fBntpq\fP to operate in interactive mode. 877280849ScyPrompts will be written to the standard output and 878280849Scycommands read from the standard input. 879280849Scy.It Fl n , Fl \-numeric 880280849Scynumeric host addresses. 881280849Scy.sp 882280849ScyOutput all host addresses in dotted\-quad numeric format rather than 883280849Scyconverting to the canonical host names. 884280849Scy.It Fl \-old\-rv 885280849ScyAlways output status line with readvar. 886280849Scy.sp 887280849ScyBy default, \fBntpq\fP now suppresses the \fBassocid=...\fP 888280849Scyline that precedes the output of \fBreadvar\fP 889280849Scy(alias \fBrv\fP) when a single variable is requested, such as 890280849Scy\fBntpq \-c "rv 0 offset"\fP. 891280849ScyThis option causes \fBntpq\fP to include both lines of output 892280849Scyfor a single\-variable \fBreadvar\fP. 893280849ScyUsing an environment variable to 894280849Scypreset this option in a script will enable both older and 895280849Scynewer \fBntpq\fP to behave identically in this regard. 896280849Scy.It Fl p , Fl \-peers 897280849ScyPrint a list of the peers. 898280849ScyThis option must not appear in combination with any of the following options: 899280849Scyinteractive. 900280849Scy.sp 901280849ScyPrint a list of the peers known to the server as well as a summary 902280849Scyof their state. This is equivalent to the 'peers' interactive command. 903298695Sdelphij.It Fl r Ar keyword , Fl \-refid Ns = Ns Ar keyword 904298695SdelphijSet default display type for S2+ refids. 905298695SdelphijThis option takes a keyword as its argument. The argument sets an enumeration value that can 906298695Sdelphijbe tested by comparing them against the option value macro. 907298695SdelphijThe available keywords are: 908298695Sdelphij.in +4 909298695Sdelphij.nf 910298695Sdelphij.na 911298695Sdelphijhash ipv4 912298695Sdelphij.fi 913298695Sdelphijor their numeric equivalent. 914298695Sdelphij.in -4 915298695Sdelphij.sp 916298695SdelphijThe default 917298695Sdelphij.Ar keyword 918298695Sdelphijfor this option is: 919298695Sdelphij.ti +4 920298695Sdelphij ipv4 921298695Sdelphij.sp 922298695SdelphijSet the default display format for S2+ refids. 923280849Scy.It Fl w , Fl \-wide 924280849ScyDisplay the full 'remote' value. 925280849Scy.sp 926280849ScyDisplay the full value of the 'remote' value. If this requires 927280849Scymore than 15 characters, display the full value, emit a newline, 928280849Scyand continue the data display properly indented on the next line. 929280849Scy.It Fl \&? , Fl \-help 930280849ScyDisplay usage information and exit. 931280849Scy.It Fl \&! , Fl \-more\-help 932280849ScyPass the extended usage information through a pager. 933280849Scy.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc 934280849ScySave the option state to \fIcfgfile\fP. The default is the \fIlast\fP 935280849Scyconfiguration file listed in the \fBOPTION PRESETS\fP section, below. 936280849ScyThe command will exit after updating the config file. 937280849Scy.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts 938280849ScyLoad options from \fIcfgfile\fP. 939280849ScyThe \fIno\-load\-opts\fP form will disable the loading 940280849Scyof earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early, 941280849Scyout of order. 942280849Scy.It Fl \-version Op Brq Ar v|c|n 943280849ScyOutput version of program and exit. The default mode is `v', a simple 944280849Scyversion. The `c' mode will print copyright information and `n' will 945280849Scyprint the full copyright notice. 946280849Scy.El 947280849Scy.Sh "OPTION PRESETS" 948280849ScyAny option that is not marked as \fInot presettable\fP may be preset 949280849Scyby loading values from configuration ("RC" or ".INI") file(s) and values from 950280849Scyenvironment variables named: 951280849Scy.nf 952280849Scy \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP 953280849Scy.fi 954280849Scy.ad 955280849ScyThe environmental presets take precedence (are processed later than) 956280849Scythe configuration files. 957280849ScyThe \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". 958280849ScyIf any of these are directories, then the file \fI.ntprc\fP 959280849Scyis searched for within those directories. 960280849Scy.Sh "ENVIRONMENT" 961280849ScySee \fBOPTION PRESETS\fP for configuration environment variables. 962280849Scy.Sh "FILES" 963280849ScySee \fBOPTION PRESETS\fP for configuration files. 964280849Scy.Sh "EXIT STATUS" 965280849ScyOne of the following exit values will be returned: 966280849Scy.Bl -tag 967280849Scy.It 0 " (EXIT_SUCCESS)" 968280849ScySuccessful program execution. 969280849Scy.It 1 " (EXIT_FAILURE)" 970280849ScyThe operation failed or the command syntax was not valid. 971280849Scy.It 66 " (EX_NOINPUT)" 972280849ScyA specified configuration file could not be loaded. 973280849Scy.It 70 " (EX_SOFTWARE)" 974280849Scylibopts had an internal operational error. Please report 975280849Scyit to autogen\-users@lists.sourceforge.net. Thank you. 976280849Scy.El 977280849Scy.Sh "AUTHORS" 978280849ScyThe University of Delaware and Network Time Foundation 979280849Scy.Sh "COPYRIGHT" 980316722SdelphijCopyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. 981280849ScyThis program is released under the terms of the NTP license, <http://ntp.org/license>. 982280849Scy.Sh "BUGS" 983280849ScyPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org 984280849Scy.Sh "NOTES" 985280849ScyThis manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP 986280849Scyoption definitions. 987