网络响应输入插件
此插件测试 UDP/TCP 连接并从结果中生成指标,包括响应时间,并可选择验证响应中的文本。
引入于: Telegraf v0.10.3 标签: network 操作系统支持: all
全局配置选项
插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md。
配置
# Collect response time of a TCP or UDP connection
[[inputs.net_response]]
## Protocol, must be "tcp" or "udp"
## NOTE: because the "udp" protocol does not respond to requests, it requires
## a send/expect string pair (see below).
protocol = "tcp"
## Server address (default localhost)
address = "localhost:80"
## Set timeout
# timeout = "1s"
## Set read timeout (only used if expecting a response)
# read_timeout = "1s"
## The following options are required for UDP checks. For TCP, they are
## optional. The plugin will send the given string to the server and then
## expect to receive the given 'expect' string back.
## string sent to the server
# send = "ssh"
## expected string in answer
# expect = "ssh"
## Uncomment to remove deprecated fields; recommended for new deploys
# fieldexclude = ["result_type", "string_found"]Metrics
- net_response
- 标签 (tags)
- 服务器
- port
- protocol
- result
- 字段 (fields)
- response_time (float, seconds)
- result_code (int) success = 0, timeout = 1, connection_failed = 2, read_failed = 3, string_mismatch = 4
- result_type (string) 1.7 版本已弃用; 请使用 result 标签
- string_found (boolean) 1.4 版本已弃用; 请使用 result 标签
- 标签 (tags)
示例输出
net_response,port=8086,protocol=tcp,result=success,server=localhost response_time=0.000092948,result_code=0i,result_type="success" 1525820185000000000
net_response,port=8080,protocol=tcp,result=connection_failed,server=localhost result_code=2i,result_type="connection_failed" 1525820088000000000
net_response,port=8080,protocol=udp,result=read_failed,server=localhost result_code=3i,result_type="read_failed",string_found=false 1525820088000000000此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 Telegraf 和本文档提出反馈和 bug 报告。要获取支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。