我ntpd在一个盒子上运行。 我想看看盒子上的时间与从ntp.ubuntu.com检索的时间相比如何。 有没有一个简单的方法来做到这一点?
ntpq -p ntp.ubuntu.com
从man ntpq
:
... -p Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the peers interactive command. ...
编辑:主机现在正在超时。 ntpq -p pool.ntp.org
将返回一个有效的结果。
您可以使用ntpdate查询时间服务器
ntpdate -q ntp.ubuntu.com
实际上,命令ntpq -c "rv 0 clock" ntp.ubuntu.com
会以标准格式返回服务器的时间:这是ca.pool.ntp.org的结果:
clock=d1b5aa9c.b8f9697a Wed, Jun 29 2011 9:43:56.722