categraf/inputs/http_response
ziv 13cc06e338 input code refactor 2022-08-01 19:00:28 +08:00
..
README.md add some doc 2022-06-13 15:58:26 +08:00
alerts.json rename plugin http_response 2022-05-14 16:26:52 +08:00
dashboard.json rename plugin http_response 2022-05-14 16:26:52 +08:00
http_response.go input code refactor 2022-08-01 19:00:28 +08:00
tls.go rename plugin http_response 2022-05-14 16:26:52 +08:00

README.md

http_response

HTTP 探测插件,用于检测 HTTP 地址的连通性、延迟、HTTPS证书过期时间

code meanings

Success          = 0
ConnectionFailed = 1
Timeout          = 2
DNSError         = 3
AddressError     = 4
BodyMismatch     = 5
CodeMismatch     = 6

Configuration

最核心的配置就是 targets 配置,配置目标地址,比如想要监控两个地址:

[[instances]]
targets = [
    "http://localhost:8080",
    "https://www.baidu.com"
]

instances 下面的所有 targets 共享同一个 [[instances]] 下面的配置比如超时时间HTTP方法等如果有些配置不同可以拆成多个不同的 [[instances]],比如:

[[instances]]
targets = [
    "http://localhost:8080",
    "https://www.baidu.com"
]
method = "GET"

[[instances]]
targets = [
    "http://localhost:9090"
]
method = "POST"

监控大盘和告警规则

该 README 的同级目录下,提供了 dashboard.json 就是监控大盘的配置alerts.json 是告警规则,可以导入夜莺使用。