xntpdc - special NTP query program
xntpdc [-ilnps] [-c command] [host] [...]
xntpdc queries the xntpd daemon about its current state and requests changes in that state. You can run xntpdc in interactive mode or in controlled using command line arguments.
Extensive state and statistics information is available through the xntpdc interface. In addition, nearly all the configuration options which can be specified at start up using xntpd's configuration file may also be specified at run time using xntpdc.
If one or more request options is included on the command line when xntpdc is executed, each of the requests is sent to the NTP servers running on each of the hosts given as command line arguments, or on the local host by default. If no request options are given, xntpdc attempts to read commands from the standard input and execute these on the NTP server running on the first host specified on the command line, again defaulting to the local host when no other host is specified. xntpdc prompts for commands if the standard input is a terminal device.
xntpdc uses NTP mode 7 packets to communicate with the NTP server, and can be used to query any compatable server on the network which permits it. As NTP is a UDP protocol, this communication is somewhat unreliable, especially over large distances. xntpdc does not attempt to re-transmit requests, and times requests out if the remote host is not heard from within a suitable timeout time.
The operation of xntpdc is specific to the particular implementation of the xntpd daemon. You can expect xntpdc to work only with this and maybe some previous versions of the daemon. Requests from a remote xntpdc program that affect the state of the local server must be authenticated. This requires that both the remote program and local server share a common key and key identifier.
xntpdc reads interactive format commands from the standard input. If you specify the -c, -l, -p or -s option, the specified queries are sent to the hosts immediately.
The following command line options are supported:
-c command-...
Multiple -c options may be specified.
-i
Prompts are written to the standard output. Commands are read from the standard input.
-l
This option is equivalent to -c listpeers. See listpeers in Control Message Commands.
-n
-p
This option is equivalent to -c peers. See peers in Control Message Commands.
-s
The interactive commands consist of a keyword (command_keyword) followed by zero to four arguments. You need to entry only enough characters of the command_keyword to uniquely identify it. The output of an interactive command is sent to the standard output by default. You can send the output of an interactive command to a file by appending a <, followed by a file name, to the command line.
A number of interactive format commands are executed entirely within the xntpdc program itself and do not result in NTP mode.
The following interactive commands are supported:
? [ command_keyword]
delay milliseconds
This enables (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Because the server no longer requires timestamps in authenticated requests, this command may be obsolete.
help [ command_keyword ]
host hostname
hostnames [ yes | no ]
Specify yes to print host names. Specify no to print numeric addresses.
The default is yes, unless the -n command line option is specified.
keyid keyid
passwd
The password is not displayed, and must correspond to the key configured for use by the NTP server for this purpose. If the password does not correspond to the key configured for use by the NTP server, requests are not successful.
quit
timeout millseconds
The default is approximately 8000 milliseconds. As xntpdc retries each query once after a timeout, the total waiting time for a timeout is twice the timeout value set.
Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These control message commands are read-only commands in that they make no modification of the server configuration state.
The following control message commands are supported:
clkbug
clockinfo clock_peer_address [...]
The values obtained provide information on the setting of fudge factors and other clock performance information.
dmpeers
The peer summary list is identical to the output of the peers command, except for the character in the leftmost column. Characters only appear beside peers which were included in the final stage of the clock selection algorithm. A . indicates that this peer was cast off in the falseticker detection, while a + indicates that the peer made it through. A * denotes the peer with which the server is currently synchronizing.
iostats
kerninfo
This information is available only if the kernel has been specially modified for a precision timekeeping function.
listpeers
These should include all configured peer associations as well as those peers whose stratum is such that they are considered by the server to be possible future synchonization candidates. candidates.
loopinfo [ oneline | multiline ]
The loop filter is the part of NTP which deals with adjusting the local system clock.
The oneline and multiline options specify the format in which this information is printed. multiline is the default.
The offset is the last offset given to the loop filter by the packet processing code. The frequency is the frequency error of the local clock in parts-per-million (ppm). The time_const controls the stiffness of the phase-lock loop and thus the speed at which it can adapt to oscillator drift. The watchdog timer value is the number of seconds which have elapsed since the last sample offset was given to the loop filter.
memstats
monlist [version]
peers
The following summary information is included:
This is represented by the character in the left margin. A + denotes symmetric active, a - indicates symmetric passive, a = means the remote server is being polled in client mode, a ^ indicates that the server is broadcasting to this address, a ~ denotes that the remote peer is sending broadcasts and a * marks the peer the server is currently synchonizing to.
This field may contain a host name, an IP address, a reference clock implementation name with its parameter or REFCLK (implementation number, parameter). On hostnames no only IP-addresses is displayed.
pstats peer_address [...]
reslist
Generally, this list is printed in sorted order.
showpeer peer_address [...]
sysinfo
The output from sysinfo is described in NTP Version 3 specification, RFC-1305. All except the last four lines are described in the NTP Version 3 specification, RFC-1305.
The system flags show various system flags, some of which can be set and cleared by the enable and disable configuration commands, respectively. These are the auth, bclient, monitor, pll, pps and stats flags. See the xntpd documentation for the meaning of these flags. There are two additional flags which are read only, the kernel_pll and kernel_pps. These flags indicate the synchronization status when the precision time kernel modifications are in use. The kernel_pll indicates that the local clock is being disciplined by the kernel, while the kernel_pps indicates the kernel discipline is provided by the PPS signal. The stability is the residual frequency error remaining after the system frequency correction is applied and is intended for maintenance and debugging. In most architectures, this value initially decreases from as high as 500 ppm to a nominal value in the range .01 to 0.1 ppm. If it remains high for some time after starting the daemon, something may be wrong with the local clock, or the value of the kernel variable tick may be incorrect. The broadcastdelay shows the default broadcast delay, as set by the broadcastdelay configuration command. The authdelay shows the default authentication delay, as set by the authdelay configuration command.
sysstats
timerstats
The server authenticates all requests that cause state changes in the server. The server uses a configured NTP key to accomplish this. This facility can also be disabled by the server by not configuring a key).
You must make the key number and the corresponding key known to xtnpdc. Use the keyid or passwd commands to do so.
The passwd command prompts users for a password to use as the encryption key. It also prompts automatically for both the key number and password the first time a command which would result in an authenticated request to the server is given. Authentication provides verification that the requester has permission to make such changes. It also gives an extra degree of protection against transmission errors.
Authenticated requests always include a time stamp in the packet data. The time stamp is included in the computation of the authentication code. This timestamp is compared by the server to its receive time stamp. If the time stamps differ by more than a small amount the request is rejected.
Time stamps are rejected for two reasons. First, it makes simple replay attacks on the server, by someone who might be able to overhear traffic on your LAN, much more difficult. Second, it makes it more difficult to request configuration changes to your server from topologically remote hosts.
While the reconfiguration facility works well with a server on the local host, and may work adequately between time-synchronized hosts on the same LAN, it works very poorly for more distant hosts. If reasonable passwords are chosen, care is taken in the distribution and protection of keys and appropriate source address restrictions are applied, the run time reconfiguration facility should provide an adequate level of security.
The following commands make authenticated requests.
addpeer peer_address [ keyid ] [ version ] [ prefer ]
If the optional keyid is a non-zero integer, all outgoing packets to the remote server will have an authentication field attached encrypted with this key. If the keyid is 0 or omitted, no authentication is done.
Specify version as 1, 2 or 3. The default is 3.
The prefer keyword indicates a preferred peer. This keyword is used primarily for clock synchronisation if possible. The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal.
addserver peer_address [ keyid ] [ version ] [ prefer ]
addtrap [ address [ port ] [ interface ]
authinfo
broadcast peer_address [ keyid ] [ version ] [ prefer ]
clrtrap [ address [ port ] [ interface]
delrestrict address mask [ ntpport ]
fudge peer_address [ time1 ] [ time2 ] [ stratum ] [ refid ]
readkeys
restrict address mask flag [ flag ]
reset
traps
trustkey keyid [...]
untrustkey keyid [...]
unconfig peer_address [...]
unrestrict address mask flag [ flag ]
See attributes(5) for descriptions of the following attributes:
|
ntpdate(1M), ntpq(1M), ntptrace(1M), xntpd(1M), rename(2), attributes(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |