Chronyd 客户查询

Chronyd 客户查询

是否可以看到来自客户端的同步查询日志?

有跟踪.日志统计.日志测量.日志但在此日志中没有客户端查询

我尝试从我的客户端使用命令查询

ntpdate -q myntpserver

但日志中没有任何内容!

在我的日志中我看到:

==> /opt/chronyd/data/log/measurements.log <==
2023-12-19 09:11:00 193.204.114.105 N  2 111 111 1111   6  6 0.44  2.759e-04  2.412e-02  2.314e-07  5.188e-04  2.455e-02 984EE531 4B K K
2023-12-19 09:12:04 193.204.114.105 N  2 111 111 1111   6  6 0.56  1.795e-04  2.357e-02  1.835e-07  5.188e-04  2.551e-02 984EE531 4B K K
2023-12-19 09:13:08 193.204.114.105 N  2 111 111 1111   6  6 0.70  9.200e-04  2.466e-02  1.635e-07  5.188e-04  2.646e-02 984EE531 4B K K
2023-12-19 09:14:13 193.204.114.105 N  2 111 111 1111   6  6 0.86 -5.213e-04  2.423e-02  1.560e-07  5.188e-04  2.744e-02 984EE531 4B K K
2023-12-19 09:15:18 193.204.114.105 N  2 111 111 1111   7  6 0.03 -1.545e-04  2.299e-02  1.438e-07  5.188e-04  2.841e-02 984EE531 4B K K
2023-12-19 09:17:28 193.204.114.105 N  2 111 111 1111   7  7 0.22  1.938e-03  2.680e-02  1.390e-07  5.188e-04  3.038e-02 984EE531 4B K K
2023-12-19 09:19:38 193.204.114.105 N  2 111 111 1111   7  7 0.42 -4.116e-03  3.037e-02  1.465e-07  5.188e-04  3.232e-02 984EE531 4B K K
2023-12-19 09:21:47 193.204.114.105 N  2 111 111 1111   7  7 0.64  5.242e-05  2.335e-02  1.374e-07  5.188e-04  3.426e-02 984EE531 4B K K
2023-12-19 09:23:57 193.204.114.105 N  2 111 111 1111   7  7 0.88  2.032e-04  2.379e-02  1.279e-07  3.662e-04  1.624e-02 984EE531 4B K K
2023-12-19 09:26:06 193.204.114.105 N  2 111 111 1111   8  7 0.12 -2.116e-04  2.450e-02  1.230e-07  3.662e-04  1.817e-02 984EE531 4B K K

==> /opt/chronyd/data/log/statistics.log <==
2023-12-19 09:11:00 193.204.114.105  8.687e-04 -2.197e-04  4.870e-04 -1.164e-07  3.852e-06 6.9e-02  15   0   7  0.00
2023-12-19 09:12:04 193.204.114.105  7.950e-04 -8.829e-05  3.884e-04 -1.488e-07  2.872e-06 3.5e-02  16   0   7  0.00
2023-12-19 09:13:08 193.204.114.105  8.066e-04 -1.942e-04  3.829e-04 -2.977e-07  2.611e-06 9.7e-02  17   0   7  0.00
2023-12-19 09:14:13 193.204.114.105  7.714e-04  1.184e-04  3.515e-04  1.081e-07  2.227e-06 6.3e-02  18   0   8  0.00
2023-12-19 09:15:18 193.204.114.105  7.019e-04  6.020e-05  2.809e-04  9.341e-08  1.730e-06 3.4e-02  19   0   8  0.00
2023-12-19 09:17:28 193.204.114.105  7.590e-04 -1.401e-04  3.379e-04 -1.500e-07  1.774e-06 9.5e-02  20   0   9  0.00
2023-12-19 09:19:38 193.204.114.105  8.579e-04  1.582e-04  4.231e-04  1.351e-07  1.916e-06 9.6e-02  21   0  10  0.00
2023-12-19 09:21:47 193.204.114.105  7.995e-04 -2.113e-05  3.584e-04  1.128e-08  1.481e-06 1.3e-02  22   0  11  0.00
2023-12-19 09:23:57 193.204.114.105  7.557e-04 -5.670e-05  3.288e-04 -4.740e-08  1.236e-06 3.3e-02  23   0  11  0.00
2023-12-19 09:26:06 193.204.114.105  7.436e-04  3.721e-05  3.262e-04  2.236e-08  1.115e-06 2.5e-02  24   0  12  0.00

==> /opt/chronyd/data/log/tracking.log <==
2023-12-19 09:11:00 193.204.114.105  3     -8.665      4.156 -2.197e-04 N  1  4.870e-04 -2.172e-04  2.498e-02  2.216e-02  3.607e-02
2023-12-19 09:12:04 193.204.114.105  3     -8.793      3.100 -8.829e-05 N  1  3.884e-04  2.535e-06  2.498e-02  2.199e-02  3.499e-02
2023-12-19 09:13:08 193.204.114.105  3     -9.034      2.821 -1.942e-04 N  1  3.829e-04  7.672e-05  2.498e-02  2.207e-02  3.484e-02
2023-12-19 09:14:13 193.204.114.105  3     -8.944      2.370  1.184e-04 N  1  3.515e-04  1.414e-04  2.498e-02  2.203e-02  3.508e-02
2023-12-19 09:15:18 193.204.114.105  3     -8.865      1.860  6.020e-05 N  1  2.809e-04  2.200e-05  2.498e-02  2.185e-02  3.477e-02
2023-12-19 09:17:28 193.204.114.105  3     -8.980      1.857 -1.401e-04 N  1  3.379e-04 -3.124e-05  2.498e-02  2.216e-02  3.476e-02
2023-12-19 09:19:38 193.204.114.105  3     -8.881      1.960  1.582e-04 N  1  4.231e-04  8.568e-05  2.498e-02  2.259e-02  3.514e-02
2023-12-19 09:21:47 193.204.114.105  3     -8.871      1.562 -2.113e-05 N  1  3.584e-04 -6.426e-05  2.498e-02  2.238e-02  3.554e-02
2023-12-19 09:23:57 193.204.114.105  3     -8.910      1.310 -5.670e-05 N  1  3.288e-04 -3.964e-05  2.416e-02  1.657e-02  3.525e-02
2023-12-19 09:26:06 193.204.114.105  3     -8.892      1.162  3.721e-05 N  1  3.262e-04  1.647e-05  2.416e-02  1.671e-02  2.896e-02

经过tcp转储我看到客户端常规连接:

10:20:37.142559 IP 192.168.88.141.50204 > 192.168.88.145.123: NTPv4, Client, length 48
10:20:37.143920 IP 192.168.88.145.123 > 192.168.88.141.50204: NTPv4, Server, length 48
10:21:08.456605 IP 192.168.88.140.53060 > 192.168.88.145.123: NTPv4, Client, length 48
10:21:08.457822 IP 192.168.88.145.123 > 192.168.88.140.53060: NTPv4, Server, length 48
10:21:09.176344 IP 192.168.88.141.52451 > 192.168.88.145.123: NTPv4, Client, length 48
10:21:09.177444 IP 192.168.88.145.123 > 192.168.88.141.52451: NTPv4, Server, length 48
10:21:40.488820 IP 192.168.88.140.54269 > 192.168.88.145.123: NTPv4, Client, length 48
10:21:40.490039 IP 192.168.88.145.123 > 192.168.88.140.54269: NTPv4, Server, length 48
10:21:41.208052 IP 192.168.88.141.53443 > 192.168.88.145.123: NTPv4, Client, length 48
10:21:41.209239 IP 192.168.88.145.123 > 192.168.88.141.53443: NTPv4, Server, length 48
10:22:13.522921 IP 192.168.88.140.35788 > 192.168.88.145.123: NTPv4, Client, length 48
10:22:13.524212 IP 192.168.88.145.123 > 192.168.88.140.35788: NTPv4, Server, length 48

但日志中没有任何内容!

提前致谢

答案1

您可以chronyd使用 来访问监控设施chronyc。就您而言,clients子命令可能就是您想要的。看man chronyc

如果我没记错的话,客户端日志记录chronyd默认是启用的,但可以通过noclientlog在配置中使用来禁用chrony.conf。另请检查设置的最大日志大小。

相关内容