Windows下檢測NTP伺服器可用性
阿新 • • 發佈:2018-12-31
在windows的cmd命令列介面使用下面的命令可以檢測NTP伺服器是否可用:
w32tm /stripchart /computer:ntp_server_address示例1:
//NTP伺服器不可用
C:\Documents and Settings\xws>w32tm /stripchart /computer:172.16.54.216
Tracking 172.16.54.216 [172.16.54.216].
The current time is 2013-10-9 10:41:02 (local time).
10:41:02 error: 0x80072746
10:41:04 error: 0x80072746
10:41:06 error: 0x80072746
10:41:08 error: 0x80072746
^C
C:\Documents and Settings\xws>
示例2:
//NTP伺服器正常
C:\Documents and Settings\xws>w32tm /stripchart /computer:172.16.54.74
Tracking 172.16.54.74 [172.16.54.74].
The current time is 2013-10-9 10:39:55 (local time).
10:39:55 d:-00.0000433s o:-2220.7617382s [@ | ]
10:39:57 d:-00.0000399s o:-2220.7593686s [@ | ]
10:39:59 d:-00.0000427s o:-2220.7582192s [@ | ]
10:40:01 d:-00.0000442s o:-2220.7566366s [@ | ]
^C
C:\Documents and Settings\xws>
返回“10:41:02 error: 0x80072746”表示NTP伺服器不可用。
返回“10:39:55 d:-00.0000433s o:-2220.7617382s [@ | ]”表示NTP伺服器正常。