DNS 查询输入插件
此插件收集有关 DNS 查询的信息,例如响应时间和结果代码。
引入于: Telegraf v1.4.0 标签: system, network 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Query given DNS server and gives statistics
[[inputs.dns_query]]
## servers to query
servers = ["8.8.8.8"]
## Network is the network protocol name.
# network = "udp"
## Domains or subdomains to query.
# domains = ["."]
## Query record type.
## Possible values: A, AAAA, CNAME, MX, NS, PTR, TXT, SOA, SPF, SRV.
# record_type = "A"
## Dns server port.
# port = 53
## Query timeout
# timeout = "2s"
## Include the specified additional properties in the resulting metric.
## The following values are supported:
## "first_ip" -- return IP of the first A and AAAA answer
## "all_ips" -- return IPs of all A and AAAA answers
# include_fields = []Metrics
- dns_query
- 标签 (tags)
- 服务器
- domain
- record_type
- result
- rcode
- 字段 (fields)
- query_time_ms (float)
- result_code (int, success = 0, timeout = 1, error = 2)
- rcode_value (int)
- 标签 (tags)
Rcode 描述
| rcode_value | rcode | 描述 |
|---|---|---|
| 0 | NoError | 无错误 |
| 1 | FormErr | 格式错误 |
| 2 | ServFail | 服务器失败 |
| 3 | NXDomain | 不存在的域名 |
| 4 | NotImp | 未实现 |
| 5 | Refused | 查询被拒绝 |
| 6 | YXDomain | 域名已存在(但不应存在) |
| 7 | YXRRSet | RR 集合已存在(但不应存在) |
| 8 | NXRRSet | 应存在的 RR 集合不存在 |
| 9 | NotAuth | 服务器不对区域授权 |
| 10 | NotZone | 名称不属于区域 |
| 16 | BADSIG | TSIG 签名失败 |
| 16 | BADVERS | 错误的 OPT 版本 |
| 17 | BADKEY | 密钥未识别 |
| 18 | BADTIME | 签名超出时间窗口 |
| 19 | BADMODE | 错误的 TKEY 模式 |
| 20 | BADNAME | 重复的密钥名称 |
| 21 | BADALG | 不支持的算法 |
| 22 | BADTRUNC | 错误的截断 |
| 23 | BADCOOKIE | 错误的/缺失的服务器 Cookie |
示例输出
dns_query,domain=google.com,rcode=NOERROR,record_type=A,result=success,server=127.0.0.1 rcode_value=0i,result_code=0i,query_time_ms=0.13746 1550020750001000000此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。