我正在使用inputs.http_response模块来观察某些URL的状态。实际上,只有一个URL,因为当我添加更多的URL时,它就停止了监视(实际上,在telegraf启动时,它会注意到一个配置错误)。
以下是我尝试过的两个例子:
[[inputs.http_response]]
address = "https://www.example.com/index.html"
response_timeout = "5s"
method = "GET"
follow_redirects = false
[[inputs.http_response]]
address = "https://blog.example.com/index.html"
response_timeout = "5s"
method = "GET"
follow_redirects = false而且还
[[inputs.http_response]]
address = ["https://www.example.com/index.html", "https://blog.example.com/index.html"]
response_timeout = "5s"
method = "GET"
follow_redirects = false没有括号也是一样。
有什么建议如何监控多个URL?
发布于 2017-11-17 16:24:24
您必须通过更改输入名称来更改telegraf输入配置。它可以通过创建名称后缀、前缀或甚至覆盖输入名称本身来完成--必须对每个新的"http_response“输入执行。类似于此示例的内容:
[[inputs.http_response]]
name_suffix = "_www"
address = "https://www.example.com/index.html"
response_timeout = "10s"
method = "GET"
follow_redirects = false
[[inputs.http_response]]
name_suffix = "_blog"
address = "https://blog.example.com/index.html"
response_timeout = "10s"
method = "GET"
follow_redirects = false在本例中,输入名称将变成http_response_www和http_response_blog。
更多信息可在:https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#input-configuration中获得
https://serverfault.com/questions/881732
复制相似问题