1.Dd March 21 2017 2.Dt NTPQ 1ntpqmdoc User Commands 3.Os 4.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc) 5.\" 6.\" It has been AutoGen-ed March 21, 2017 at 10:45:31 AM by AutoGen 5.18.5 7.\" From the definitions ntpq-opts.def 8.\" and the template file agmdoc-cmd.tpl 9.Sh NAME 10.Nm ntpq 11.Nd standard NTP query program 12.Sh SYNOPSIS 13.Nm 14.\" Mixture of short (flag) options and long options 15.Op Fl flags 16.Op Fl flag Op Ar value 17.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc 18[ host ...] 19.Pp 20.Sh DESCRIPTION 21The 22.Nm 23utility program is used to query NTP servers which 24implement the standard NTP mode 6 control message formats defined 25in Appendix B of the NTPv3 specification RFC1305, requesting 26information about current state and/or changes in that state. 27The same formats are used in NTPv4, although some of the 28variables have changed and new ones added. The description on this 29page is for the NTPv4 variables. 30The program may be run either in interactive mode or controlled using 31command line arguments. 32Requests to read and write arbitrary 33variables can be assembled, with raw and pretty\-printed output 34options being available. 35The 36.Nm 37utility can also obtain and print a 38list of peers in a common format by sending multiple queries to the 39server. 40If one or more request options is included on the command line 41when 42.Nm 43is executed, each of the requests will be sent 44to the NTP servers running on each of the hosts given as command 45line arguments, or on localhost by default. 46If no request options 47are given, 48.Nm 49will attempt to read commands from the 50standard input and execute these on the NTP server running on the 51first host given on the command line, again defaulting to localhost 52when no other host is specified. 53The 54.Nm 55utility will prompt for 56commands if the standard input is a terminal device. 57.Nm 58uses NTP mode 6 packets to communicate with the 59NTP server, and hence can be used to query any compatible server on 60the network which permits it. 61Note that since NTP is a UDP protocol 62this communication will be somewhat unreliable, especially over 63large distances in terms of network topology. 64The 65.Nm 66utility makes 67one attempt to retransmit requests, and will time requests out if 68the remote host is not heard from within a suitable timeout 69time. 70Specifying a 71command line option other than 72.Fl i 73or 74.Fl n 75will 76cause the specified query (queries) to be sent to the indicated 77host(s) immediately. 78Otherwise, 79.Nm 80will attempt to read 81interactive format commands from the standard input. 82.Ss "Internal Commands" 83Interactive format commands consist of a keyword followed by zero 84to four arguments. 85Only enough characters of the full keyword to 86uniquely identify the command need be typed. 87A 88number of interactive format commands are executed entirely within 89the 90.Nm 91utility itself and do not result in NTP mode 6 92requests being sent to a server. 93These are described following. 94.Bl -tag -width "? [command_keyword]" -compact -offset indent 95.It Ic ? Op Ar command_keyword 96.It Ic help Op Ar command_keyword 97A 98.Ql \&? 99by itself will print a list of all the command 100keywords known to this incarnation of 101.Nm . 102A 103.Ql \&? 104followed by a command keyword will print function and usage 105information about the command. 106This command is probably a better 107source of information about 108.Nm 109than this manual 110page. 111.It Ic addvars Ar variable_name Ns Xo Op Ic =value 112.Ic ... 113.Xc 114.It Ic rmvars Ar variable_name Ic ... 115.It Ic clearvars 116.It Ic showvars 117The data carried by NTP mode 6 messages consists of a list of 118items of the form 119.Ql variable_name=value , 120where the 121.Ql =value 122is ignored, and can be omitted, 123in requests to the server to read variables. 124The 125.Nm 126utility maintains an internal list in which data to be included in control 127messages can be assembled, and sent using the 128.Ic readlist 129and 130.Ic writelist 131commands described below. 132The 133.Ic addvars 134command allows variables and their optional values to be added to 135the list. 136If more than one variable is to be added, the list should 137be comma\-separated and not contain white space. 138The 139.Ic rmvars 140command can be used to remove individual variables from the list, 141while the 142.Ic clearlist 143command removes all variables from the 144list. 145The 146.Ic showvars 147command displays the current list of optional variables. 148.It Ic authenticate Op yes | no 149Normally 150.Nm 151does not authenticate requests unless 152they are write requests. 153The command 154.Ql authenticate yes 155causes 156.Nm 157to send authentication with all requests it 158makes. 159Authenticated requests causes some servers to handle 160requests slightly differently, and can occasionally melt the CPU in 161fuzzballs if you turn authentication on before doing a 162.Ic peer 163display. 164The command 165.Ql authenticate 166causes 167.Nm 168to display whether or not 169.Nm 170is currently autheinticating requests. 171.It Ic cooked 172Causes output from query commands to be "cooked", so that 173variables which are recognized by 174.Nm 175will have their 176values reformatted for human consumption. 177Variables which 178.Nm 179thinks should have a decodable value but didn't are 180marked with a trailing 181.Ql \&? . 182.It Xo 183.Ic debug 184.Oo 185.Cm more | 186.Cm less | 187.Cm off 188.Oc 189.Xc 190With no argument, displays the current debug level. 191Otherwise, the debug level is changed to the indicated level. 192.It Ic delay Ar milliseconds 193Specify a time interval to be added to timestamps included in 194requests which require authentication. 195This is used to enable 196(unreliable) server reconfiguration over long delay network paths 197or between machines whose clocks are unsynchronized. 198Actually the 199server does not now require timestamps in authenticated requests, 200so this command may be obsolete. 201.It Ic exit 202Exit 203.Nm . 204.It Ic host Ar hostname 205Set the host to which future queries will be sent. 206.Ar hostname 207may be either a host name or a numeric address. 208.It Ic hostnames Op Cm yes | Cm no 209If 210.Cm yes 211is specified, host names are printed in 212information displays. 213If 214.Cm no 215is specified, numeric 216addresses are printed instead. 217The default is 218.Cm yes , 219unless 220modified using the command line 221.Fl n 222switch. 223.It Ic keyid Ar keyid 224This command allows the specification of a key number to be 225used to authenticate configuration requests. 226This must correspond 227to the 228.Cm controlkey 229key number the server has been configured to use for this 230purpose. 231.It Ic keytype Xo Oo 232.Cm md5 | 233.Cm OpenSSLDigestType 234.Oc 235.Xc 236Specify the type of key to use for authenticating requests. 237.Cm md5 238is alway supported. 239If 240.Nm 241was built with OpenSSL support, 242any digest type supported by OpenSSL can also be provided. 243If no argument is given, the current 244.Ic keytype 245is displayed. 246.It Ic ntpversion Xo Oo 247.Cm 1 | 248.Cm 2 | 249.Cm 3 | 250.Cm 4 251.Oc 252.Xc 253Sets the NTP version number which 254.Nm 255claims in 256packets. 257Defaults to 3, and note that mode 6 control messages (and 258modes, for that matter) didn't exist in NTP version 1. 259There appear 260to be no servers left which demand version 1. 261With no argument, displays the current NTP version that will be used 262when communicating with servers. 263.It Ic passwd 264This command prompts you to type in a password (which will not 265be echoed) which will be used to authenticate configuration 266requests. 267The password must correspond to the key configured for 268use by the NTP server for this purpose if such requests are to be 269successful. 270.\" Not yet implemented. 271.\" .It Ic poll 272.\" .Op Ar n 273.\" .Op Ic verbose 274.\" Poll an NTP server in client mode 275.\" .Ar n 276.\" times. 277.It Ic quit 278Exit 279.Nm . 280.It Ic raw 281Causes all output from query commands is printed as received 282from the remote server. 283The only formating/interpretation done on 284the data is to transform nonascii data into a printable (but barely 285understandable) form. 286.It Ic timeout Ar milliseconds 287Specify a timeout period for responses to server queries. 288The 289default is about 5000 milliseconds. 290Note that since 291.Nm 292retries each query once after a timeout, the total waiting time for 293a timeout will be twice the timeout value set. 294.It Ic version 295Print the version of the 296.Nm 297program. 298.El 299.Ss "Control Message Commands" 300Association IDs are used to identify system, peer and clock variables. 301System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace. 302Most control commands send a single mode\-6 message to the server and expect a single response message. 303The exceptions are the 304.Li peers 305command, which sends a series of messages, 306and the 307.Li mreadlist 308and 309.Li mreadvar 310commands, which iterate over a range of associations. 311.Bl -tag -width "something" -compact -offset indent 312.It Cm associations 313Display a list of mobilized associations in the form: 314.Dl ind assid status conf reach auth condition last_event cnt 315.Bl -column -offset indent ".Sy Variable" ".Sy Description" 316.It Sy String Ta Sy Description 317.It Li ind Ta index on this list 318.It Li assid Ta association ID 319.It Li status Ta peer status word 320.It Li conf Ta Li yes : persistent, Li no : ephemeral 321.It Li reach Ta Li yes : reachable, Li no : unreachable 322.It Li auth Ta Li ok , Li yes , Li bad and Li none 323.It Li condition Ta selection status (see the Li select field of the peer status word) 324.It Li last_event Ta event report (see the Li event field of the peer status word) 325.It Li cnt Ta event count (see the Li count field of the peer status word) 326.El 327.It Cm authinfo 328Display the authentication statistics. 329.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ... 330.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ... 331Display a list of clock variables for those associations supporting a reference clock. 332.It Cm :config Op ... 333Send 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. 334.It Cm config\-from\-file Ar filename 335Send the each line of 336.Ar filename 337to 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. 338.It Ic ifstats 339Display statistics for each local network address. Authentication is required. 340.It Ic iostats 341Display network and reference clock I/O statistics. 342.It Ic kerninfo 343Display 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. 344.It Ic lassociations 345Perform the same function as the associations command, except display mobilized and unmobilized associations. 346.It Ic lopeers Xo 347.Oo Ic \-4 | 348.Ic \-6 349.Oc 350.Xc 351Obtain and print a list of all peers and clients showing 352.Ar dstadr 353(associated with any given IP version). 354.It Ic lpeers Xo 355.Oo Ic \-4 | 356.Ic \-6 357.Oc 358.Xc 359Print a peer spreadsheet for the appropriate IP version(s). 360.Ar dstadr 361(associated with any given IP version). 362.It Ic monstats 363Display monitor facility statistics. 364.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 365Obtain and print traffic counts collected and maintained by the monitor facility. 366With the exception of 367.Cm sort Ns = Ns Ar sortorder , 368the options filter the list returned by 369.Cm ntpd. 370The 371.Cm limited 372and 373.Cm kod 374options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response. 375The 376.Cm mincount Ns = Ns Ar count 377option filters entries representing less than 378.Ar count 379packets. 380The 381.Cm laddr Ns = Ns Ar localaddr 382option filters entries for packets received on any local address other than 383.Ar localaddr . 384.Cm resany Ns = Ns Ar hexmask 385and 386.Cm resall Ns = Ns Ar hexmask 387filter entries containing none or less than all, respectively, of the bits in 388.Ar hexmask , 389which must begin with 390.Cm 0x . 391The 392.Ar sortorder 393defaults to 394.Cm lstint 395and may be any of 396.Cm addr , 397.Cm count , 398.Cm avgint , 399.Cm lstint , 400or any of those preceded by a minus sign (hyphen) to reverse the sort order. 401The output columns are: 402.Bl -tag -width "something" -compact -offset indent 403.It Column 404Description 405.It Ic lstint 406Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by 407.Nm . 408.It Ic avgint 409Average interval in s between packets from this address. 410.It Ic rstr 411Restriction flags associated with this address. 412Most are copied unchanged from the matching 413.Ic restrict 414command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response. 415.It Ic r 416Rate control indicator, either 417a period, 418.Ic L 419or 420.Ic K 421for no rate control response, 422rate limiting by discarding, or rate limiting with a KoD response, respectively. 423.It Ic m 424Packet mode. 425.It Ic v 426Packet version number. 427.It Ic count 428Packets received from this address. 429.It Ic rport 430Source port of last packet from this address. 431.It Ic remote address 432DNS name, numeric address, or address followed by 433claimed DNS name which could not be verified in parentheses. 434.El 435.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ... 436.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ... 437Perform the same function as the 438.Ic readvar 439command, except for a range of association IDs. 440This range is determined from the association list cached by the most recent 441.Ic associations 442command. 443.It Ic opeers Xo 444.Oo Ic \-4 | 445.Ic \-6 446.Oc 447.Xc 448Obtain and print the old\-style list of all peers and clients showing 449.Ar dstadr 450(associated with any given IP version), 451rather than the 452.Ar refid . 453.It Ic passociations 454Perform the same function as the 455.Ic associations 456command, 457except that it uses previously stored data rather than making a new query. 458.It Ic peers 459Display a list of peers in the form: 460.Dl [tally]remote refid st t when pool reach delay offset jitter 461.Bl -tag -width "something" -compact -offset indent 462.It Variable 463Description 464.It Ic [tally] 465single\-character code indicating current value of the 466.Ic select 467field of the 468.Lk decode.html#peer "peer status word" 469.It Ic remote 470host name (or IP number) of peer. 471The value displayed will be truncated to 15 characters unless the 472.Fl w 473flag is given, in which case the full value will be displayed 474on the first line, 475and the remaining data is displayed on the next line. 476.It Ic refid 477association ID or 478.Lk decode.html#kiss "'kiss code" 479.It Ic st 480stratum 481.It Ic t 482.Ic u : 483unicast or manycast client, 484.Ic b : 485broadcast or multicast client, 486.Ic l : 487local (reference clock), 488.Ic s : 489symmetric (peer), 490.Ic A : 491manycast server, 492.Ic B : 493broadcast server, 494.Ic M : 495multicast server 496.It Ic when 497sec/min/hr since last received packet 498.It Ic poll 499poll interval (log2 s) 500.It Ic reach 501reach shift register (octal) 502.It Ic delay 503roundtrip delay 504.It Ic offset 505offset of server relative to this host 506.It Ic jitter 507jitter 508.El 509.It Ic apeers 510Display a list of peers in the form: 511.Dl [tally]remote refid assid st t when pool reach delay offset jitter 512where the output is just like the 513.Ic peers 514command except that the 515.Ic refid 516is displayed in hex format and the association number is also displayed. 517.It Ic pstats Ar assocID 518Show the statistics for the peer with the given 519.Ar assocID . 520.It Ic readlist Ar assocID 521.It Ic rl Ar assocID 522Read the system or peer variables included in the variable list. 523.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc 524.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc Oo , ... Oc 525Display the specified variables. 526If 527.Ar assocID 528is zero, the variables are from the 529.Sx System Variables 530name space, otherwise they are from the 531.Sx Peer Variables 532name space. 533The 534.Ar assocID 535is required, as the same name can occur in both spaces. 536If no 537.Ar name 538is included, all operative variables in the name space are displayed. 539In this case only, if the 540.Ar assocID 541is omitted, it is assumed zero. 542Multiple names are specified with comma separators and without whitespace. 543Note that time values are represented in milliseconds 544and frequency values in parts\-per\-million (PPM). 545Some NTP timestamps are represented in the format 546YYYYMMDDTTTT , 547where YYYY is the year, 548MM the month of year, 549DD the day of month and 550TTTT the time of day. 551.It Ic reslist 552Show the access control (restrict) list for 553.Nm . 554.It Ic saveconfig Ar filename 555Write the current configuration, 556including any runtime modifications given with 557.Ic :config 558or 559.Ic config\-from\-file , 560to the ntpd host's file 561.Ar filename . 562This command will be rejected by the server unless 563.Lk miscopt.html#saveconfigdir "saveconfigdir" 564appears in the 565.Ic ntpd 566configuration file. 567.Ar filename 568can use 569.Xr strftime 570format specifies to substitute the current date and time, for example, 571.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] . 572The filename used is stored in system variable 573.Ic savedconfig . 574Authentication is required. 575.It Ic timerstats 576Display interval timer counters. 577.It Ic writelist Ar assocID 578Write the system or peer variables included in the variable list. 579.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ... 580Write the specified variables. 581If the 582.Ar assocID 583is zero, the variables are from the 584.Sx System Variables 585name space, otherwise they are from the 586.Sx Peer Variables 587name space. 588The 589.Ar assocID 590is required, as the same name can occur in both spaces. 591.It Ic sysinfo 592Display operational summary. 593.It Ic sysstats 594Print statistics counters maintained in the protocol module. 595.El 596.Ss Status Words and Kiss Codes 597The current state of the operating program is shown 598in a set of status words 599maintained by the system. 600Status information is also available on a per\-association basis. 601These words are displayed in the 602.Ic rv 603and 604.Ic as 605commands both in hexadecimal and in decoded short tip strings. 606The codes, tips and short explanations are documented on the 607.Lk decode.html "Event Messages and Status Words" 608page. 609The page also includes a list of system and peer messages, 610the code for the latest of which is included in the status word. 611.Pp 612Information resulting from protocol machine state transitions 613is displayed using an informal set of ASCII strings called 614.Lk decode.html#kiss "kiss codes" . 615The original purpose was for kiss\-o'\-death (KoD) packets 616sent by the server to advise the client of an unusual condition. 617They are now displayed, when appropriate, 618in the reference identifier field in various billboards. 619.Ss System Variables 620The following system variables appear in the 621.Ic rv 622billboard. 623Not all variables are displayed in some configurations. 624.Bl -tag -width "something" -compact -offset indent 625.It Variable 626Description 627.It Ic status 628.Lk decode.html#sys "system status word" 629.It Ic version 630NTP software version and build time 631.It Ic processor 632hardware platform and version 633.It Ic system 634operating system and version 635.It Ic leap 636leap warning indicator (0\-3) 637.It Ic stratum 638stratum (1\-15) 639.It Ic precision 640precision (log2 s) 641.It Ic rootdelay 642total roundtrip delay to the primary reference clock 643.It Ic rootdisp 644total dispersion to the primary reference clock 645.It Ic peer 646system peer association ID 647.It Ic tc 648time constant and poll exponent (log2 s) (3\-17) 649.It Ic mintc 650minimum time constant (log2 s) (3\-10) 651.It Ic clock 652date and time of day 653.It Ic refid 654reference ID or 655.Lk decode.html#kiss "kiss code" 656.It Ic reftime 657reference time 658.It Ic offset 659combined offset of server relative to this host 660.It Ic sys_jitter 661combined system jitter 662.It Ic frequency 663frequency offset (PPM) relative to hardware clock 664.It Ic clk_wander 665clock frequency wander (PPM) 666.It Ic clk_jitter 667clock jitter 668.It Ic tai 669TAI\-UTC offset (s) 670.It Ic leapsec 671NTP seconds when the next leap second is/was inserted 672.It Ic expire 673NTP seconds when the NIST leapseconds file expires 674.El 675The jitter and wander statistics are exponentially\-weighted RMS averages. 676The system jitter is defined in the NTPv4 specification; 677the clock jitter statistic is computed by the clock discipline module. 678.Pp 679When the NTPv4 daemon is compiled with the OpenSSL software library, 680additional system variables are displayed, 681including some or all of the following, 682depending on the particular Autokey dance: 683.Bl -tag -width "something" -compact -offset indent 684.It Variable 685Description 686.It Ic host 687Autokey host name for this host 688.It Ic ident 689Autokey group name for this host 690.It Ic flags 691host flags (see Autokey specification) 692.It Ic digest 693OpenSSL message digest algorithm 694.It Ic signature 695OpenSSL digest/signature scheme 696.It Ic update 697NTP seconds at last signature update 698.It Ic cert 699certificate subject, issuer and certificate flags 700.It Ic until 701NTP seconds when the certificate expires 702.El 703.Ss Peer Variables 704The following peer variables appear in the 705.Ic rv 706billboard for each association. 707Not all variables are displayed in some configurations. 708.Bl -tag -width "something" -compact -offset indent 709.It Variable 710Description 711.It Ic associd 712association ID 713.It Ic status 714.Lk decode.html#peer "peer status word" 715.It Ic srcadr 716source (remote) IP address 717.It Ic srcport 718source (remote) port 719.It Ic dstadr 720destination (local) IP address 721.It Ic dstport 722destination (local) port 723.It Ic leap 724leap indicator (0\-3) 725.It Ic stratum 726stratum (0\-15) 727.It Ic precision 728precision (log2 s) 729.It Ic rootdelay 730total roundtrip delay to the primary reference clock 731.It Ic rootdisp 732total root dispersion to the primary reference clock 733.It Ic refid 734reference ID or 735.Lk decode.html#kiss "kiss code" 736.It Ic reftime 737reference time 738.It Ic reach 739reach register (octal) 740.It Ic unreach 741unreach counter 742.It Ic hmode 743host mode (1\-6) 744.It Ic pmode 745peer mode (1\-5) 746.It Ic hpoll 747host poll exponent (log2 s) (3\-17) 748.It Ic ppoll 749peer poll exponent (log2 s) (3\-17) 750.It Ic headway 751headway (see 752.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" ) 753.It Ic flash 754.Lk decode.html#flash "flash status word" 755.It Ic offset 756filter offset 757.It Ic delay 758filter delay 759.It Ic dispersion 760filter dispersion 761.It Ic jitter 762filter jitter 763.It Ic ident 764Autokey group name for this association 765.It Ic bias 766unicast/broadcast bias 767.It Ic xleave 768interleave delay (see 769.Lk xleave.html "NTP Interleaved Modes" ) 770.El 771The 772.Ic bias 773variable is calculated when the first broadcast packet is received 774after the calibration volley. 775It represents the offset of the broadcast subgraph relative to the unicast subgraph. 776The 777.Ic xleave 778variable appears only for the interleaved symmetric and interleaved modes. 779It represents the internal queuing, buffering and transmission delays 780for the preceding packet. 781.Pp 782When the NTPv4 daemon is compiled with the OpenSSL software library, 783additional peer variables are displayed, including the following: 784.Bl -tag -width "something" -compact -offset indent 785.It Variable 786Description 787.It Ic flags 788peer flags (see Autokey specification) 789.It Ic host 790Autokey server name 791.It Ic flags 792peer flags (see Autokey specification) 793.It Ic signature 794OpenSSL digest/signature scheme 795.It Ic initsequence 796initial key ID 797.It Ic initkey 798initial key index 799.It Ic timestamp 800Autokey signature timestamp 801.El 802.Ss Clock Variables 803The following clock variables appear in the 804.Ic cv 805billboard for each association with a reference clock. 806Not all variables are displayed in some configurations. 807.Bl -tag -width "something" -compact -offset indent 808.It Variable 809Description 810.It Ic associd 811association ID 812.It Ic status 813.Lk decode.html#clock "clock status word" 814.It Ic device 815device description 816.It Ic timecode 817ASCII time code string (specific to device) 818.It Ic poll 819poll messages sent 820.It Ic noreply 821no reply 822.It Ic badformat 823bad format 824.It Ic baddata 825bad date or time 826.It Ic fudgetime1 827fudge time 1 828.It Ic fudgetime2 829fudge time 2 830.It Ic stratum 831driver stratum 832.It Ic refid 833driver reference ID 834.It Ic flags 835driver flags 836.El 837.Sh "OPTIONS" 838.Bl -tag 839.It Fl 4 , Fl \-ipv4 840Force IPv4 DNS name resolution. 841This option must not appear in combination with any of the following options: 842ipv6. 843.sp 844Force DNS resolution of following host names on the command line 845to the IPv4 namespace. 846.It Fl 6 , Fl \-ipv6 847Force IPv6 DNS name resolution. 848This option must not appear in combination with any of the following options: 849ipv4. 850.sp 851Force DNS resolution of following host names on the command line 852to the IPv6 namespace. 853.It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 854run a command and exit. 855This option may appear an unlimited number of times. 856.sp 857The following argument is interpreted as an interactive format command 858and is added to the list of commands to be executed on the specified 859host(s). 860.It Fl d , Fl \-debug\-level 861Increase debug verbosity level. 862This option may appear an unlimited number of times. 863.sp 864.It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 865Set the debug verbosity level. 866This option may appear an unlimited number of times. 867This option takes an integer number as its argument. 868.sp 869.It Fl i , Fl \-interactive 870Force ntpq to operate in interactive mode. 871This option must not appear in combination with any of the following options: 872command, peers. 873.sp 874Force \fBntpq\fP to operate in interactive mode. 875Prompts will be written to the standard output and 876commands read from the standard input. 877.It Fl n , Fl \-numeric 878numeric host addresses. 879.sp 880Output all host addresses in dotted\-quad numeric format rather than 881converting to the canonical host names. 882.It Fl \-old\-rv 883Always output status line with readvar. 884.sp 885By default, \fBntpq\fP now suppresses the \fBassocid=...\fP 886line that precedes the output of \fBreadvar\fP 887(alias \fBrv\fP) when a single variable is requested, such as 888\fBntpq \-c "rv 0 offset"\fP. 889This option causes \fBntpq\fP to include both lines of output 890for a single\-variable \fBreadvar\fP. 891Using an environment variable to 892preset this option in a script will enable both older and 893newer \fBntpq\fP to behave identically in this regard. 894.It Fl p , Fl \-peers 895Print a list of the peers. 896This option must not appear in combination with any of the following options: 897interactive. 898.sp 899Print a list of the peers known to the server as well as a summary 900of their state. This is equivalent to the 'peers' interactive command. 901.It Fl r Ar keyword , Fl \-refid Ns = Ns Ar keyword 902Set default display type for S2+ refids. 903This option takes a keyword as its argument. The argument sets an enumeration value that can 904be tested by comparing them against the option value macro. 905The available keywords are: 906.in +4 907.nf 908.na 909hash ipv4 910.fi 911or their numeric equivalent. 912.in -4 913.sp 914The default 915.Ar keyword 916for this option is: 917.ti +4 918 ipv4 919.sp 920Set the default display format for S2+ refids. 921.It Fl w , Fl \-wide 922Display the full 'remote' value. 923.sp 924Display the full value of the 'remote' value. If this requires 925more than 15 characters, display the full value, emit a newline, 926and continue the data display properly indented on the next line. 927.It Fl \&? , Fl \-help 928Display usage information and exit. 929.It Fl \&! , Fl \-more\-help 930Pass the extended usage information through a pager. 931.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc 932Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP 933configuration file listed in the \fBOPTION PRESETS\fP section, below. 934The command will exit after updating the config file. 935.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts 936Load options from \fIcfgfile\fP. 937The \fIno\-load\-opts\fP form will disable the loading 938of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early, 939out of order. 940.It Fl \-version Op Brq Ar v|c|n 941Output version of program and exit. The default mode is `v', a simple 942version. The `c' mode will print copyright information and `n' will 943print the full copyright notice. 944.El 945.Sh "OPTION PRESETS" 946Any option that is not marked as \fInot presettable\fP may be preset 947by loading values from configuration ("RC" or ".INI") file(s) and values from 948environment variables named: 949.nf 950 \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP 951.fi 952.ad 953The environmental presets take precedence (are processed later than) 954the configuration files. 955The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". 956If any of these are directories, then the file \fI.ntprc\fP 957is searched for within those directories. 958.Sh "ENVIRONMENT" 959See \fBOPTION PRESETS\fP for configuration environment variables. 960.Sh "FILES" 961See \fBOPTION PRESETS\fP for configuration files. 962.Sh "EXIT STATUS" 963One of the following exit values will be returned: 964.Bl -tag 965.It 0 " (EXIT_SUCCESS)" 966Successful program execution. 967.It 1 " (EXIT_FAILURE)" 968The operation failed or the command syntax was not valid. 969.It 66 " (EX_NOINPUT)" 970A specified configuration file could not be loaded. 971.It 70 " (EX_SOFTWARE)" 972libopts had an internal operational error. Please report 973it to autogen\-users@lists.sourceforge.net. Thank you. 974.El 975.Sh "AUTHORS" 976The University of Delaware and Network Time Foundation 977.Sh "COPYRIGHT" 978Copyright (C) 1992\-2017 The University of Delaware and Network Time Foundation all rights reserved. 979This program is released under the terms of the NTP license, <http://ntp.org/license>. 980.Sh "BUGS" 981Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org 982.Sh "NOTES" 983This manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP 984option definitions. 985