ここの投稿に従って、w32tmの出力を解析し、読みやすいデータテーブルにアイテムを配置しようとしています。順序付けされていない、間違って配置された結果が別の列に表示されていることに気付きました。
テストでは、これを入力すると:
w32tm /monitor /domain:mydomain.com.au /Threads:5
各サーバーを正しく順序付けてフォーマットし、NTPオフセットとICMP遅延を次のように完全に表示します。
kesvm001.mydomain.com.au[xxx.xxx.xxx.x:xxx]:
ICMP: 37ms delay
NTP: -0.0446479s offset from VM021.mydomain.com.au
RefID: VM021.mydomain.com.au [xxx.xxx.xx.xxx]
Stratum: 4
VM033.mydomain.com.au[xxx.xxx.xxx.xx:xxx]:
ICMP: 50ms delay
NTP: -0.0640493s offset from VM021.mydomain.com.au
RefID: 80.84.77.86.rev.sfr.net [xx.xx.xx.xx]
Stratum: 2
私がこれを行う場合:
$output = & w32tm /monitor /domain:mydomain.com.au /Threads:5
$output
私がそれが何をしているのかを説明できる唯一の方法は、それがすべての詳細な情報も出力しているように見えるということです...
Getting AD DC list for mydomain.com.au
Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:Analyzing:delayoffset from VM021.mydomain.com.au
Stratum: 4
1 2 -- (0 of 48)
11 12 3 (9 of 48)
16 13 17 (14 of 48)
21 18 20 (18 of 48)
26 18 27 (24 of 48)
26 18 28 (25 of 48)
26 18 30 (27 of 48)
26 18 31 (28 of 48)
26 18 32 (29 of 48)
26 18 32 (29 of 48)
33 34 32 (31 of 48)
39 40 41 (38 of 48)
42 46 41 (43 of 48)
42 -- 41 (46 of 48)
-- -- 41 (47 of 48)
-- -- 41 (47 of 48)
-- -- 41 (47 of 48)
-- -- 41 (47 of 48)
kesvm001.mydomain.com.au[xxx.xxx.xxx.xxx:xxx]:
ICMP: 37ms
NTP: -0.1127470s RefID: VM021.mydomain.com.au [192.168.48.150]
VM033.mydomain.com.au[xxx.xxx.xxdelayoffset from VM021.mydomain.com.au
Stratum: 2
delayoffset from VM021.mydomain.com.au
Stratum: 4
delayoffset from VM021.mydomain.com.au
Stratum: 3
delayoffset from VM021.mydomain.com.au
Stratum: 4
delayoffset from VM021.mydomain.com.au
Stratum: 4
delayoffset from VM021.mydomain.com.au
Stratum: 4
delayoffset from VM021.mydomain.com.au
Stratum: 4
delayoffset from VM021.mydomain.com.au
複数のスレッドを使用しているのではないかと思いましたが、スレッドを1に変更しても違いはありません。ここで何が起こっているのですか?私がしているのは(私が思った)、通常画面に表示される出力を取得し、それを変数に配置することだけでした...