1
0
Files
DiAL/docs/user/checkers/tcp.md

1.6 KiB

TCP Checker

type: tcp 用于 TCP 端口可达性和可选 banner 探测。

配置项

字段 说明 必填 默认值
tcp.host 目标主机地址
tcp.port 目标端口,范围 1-65535
tcp.readBanner 是否读取服务端 banner false
tcp.bannerReadTimeout banner 读取超时,毫秒 2000
tcp.maxBannerBytes banner 最大字节数,支持 KBMBGB 单位 4KB

expect 校验项

字段 说明 必填 默认值
connected 期望连接结果,true 可达或 false 期望不可达 true
banner Banner 内容校验,使用 ContentExpectations 数组,需开启 tcp.readBanner
durationMs 完整执行耗时校验,使用 ValueMatcher

示例

- id: "redis-port"
  name: "Redis 端口可达"
  type: tcp
  tcp:
    host: "127.0.0.1"
    port: 6379
  expect:
    durationMs:
      lte: 3000