W32Time
W32Time 采集器通过 Windows Performance Data Helper 计数器监控本机 Windows Time Service,不执行或解析 w32tm 输出。
配置¶
前置条件¶
- Windows Server 2016 及以上版本,或 Windows 10 周年更新及以上版本、Windows 11
- Windows 64 位 DataKit(
windows/amd64) - 系统已注册 Windows Time(
W32Time)服务,无需额外安装w32tm或其他程序
当 W32Time 服务未运行时,采集器仍会上报 service_running=0,其他时间同步指标只有在服务运行且对应性能计数器可用时才会上报。
采集器配置¶
进入 DataKit 安装目录下的 conf.d/samples 目录,复制 w32time.conf.sample 并命名为 w32time.conf,配置如下:
[[inputs.w32time]]
## Collect interval, default is 60 seconds.
interval = "60s"
[inputs.w32time.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
配置完成后,重启 DataKit。
指标¶
w32time¶
| Tags & Fields | Description |
|---|---|
| host ( tag) |
Host name. |
| computed_time_offset | Absolute offset between the system clock and the time source selected by W32Time, in seconds. Type: float | (gauge) Unit: time,s |
| ntp_client_source_count | Number of active NTP time source addresses responding to the Windows NTP client. Type: int | (gauge) Unit: count |
| ntp_roundtrip_delay | Most recent NTP client round-trip delay reported by W32Time, in seconds. Type: float | (gauge) Unit: time,s |
| service_running | Whether the Windows Time Service is running. A value of 1 means running and 0 means stopped. Type: int | (gauge) Unit: N/A |