Skip to content

Instantly share code, notes, and snippets.

@sergeycherepanov
Last active July 31, 2017 12:51
Show Gist options
  • Save sergeycherepanov/e54a1e7e3fb0a7f71ddb82b24d73f3fe to your computer and use it in GitHub Desktop.
Save sergeycherepanov/e54a1e7e3fb0a7f71ddb82b24d73f3fe to your computer and use it in GitHub Desktop.
http_response_alert.tick
stream
|from()
.database('telegraf')
.measurement('http_response')
.groupBy('server')
|where(lambda: "company" == 'pradam.com')
|alert()
.id('HTTPCHECK {{ index .Tags "server" }}')
.crit(lambda: "http_response_code" > 400)
.crit(lambda: "response_string_match" != 1)
.email('info@bikerbazar.com')
.email('s@cherepanov.co')
.stateChangesOnly()
[[inputs.http_response]]
address = "http://pradam.com"
response_timeout = "5s"
method = "GET"
follow_redirects = false
response_string_match = "Pradam.com"
interval = "15s"
[inputs.http_response.tags]
company = "pradam.com"
[[inputs.http_response]]
address = "http://abvgde.com.ua"
response_timeout = "5s"
method = "GET"
follow_redirects = false
response_string_match = "Abvgde.com.ua"
interval = "15s"
[inputs.http_response.tags]
company = "pradam.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment