2016-03-31 07:33:28 +00:00
|
|
|
# Example Input Plugin
|
|
|
|
|
|
|
|
This input plugin will test HTTP/HTTPS connections.
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```
|
2016-05-23 12:33:43 +00:00
|
|
|
# HTTP/HTTPS request given an address a method and a timeout
|
2016-03-31 07:33:28 +00:00
|
|
|
[[inputs.http_response]]
|
2016-03-31 10:18:19 +00:00
|
|
|
## Server address (default http://localhost)
|
2017-08-15 18:50:08 +00:00
|
|
|
# address = "http://localhost"
|
|
|
|
|
2016-04-07 01:57:49 +00:00
|
|
|
## Set response_timeout (default 5 seconds)
|
2017-08-15 18:50:08 +00:00
|
|
|
# response_timeout = "5s"
|
|
|
|
|
2016-03-31 11:06:47 +00:00
|
|
|
## HTTP Request Method
|
2017-08-15 18:50:08 +00:00
|
|
|
# method = "GET"
|
|
|
|
|
2016-03-31 10:18:19 +00:00
|
|
|
## Whether to follow redirects from the server (defaults to false)
|
2017-08-15 18:50:08 +00:00
|
|
|
# follow_redirects = false
|
|
|
|
|
2016-03-31 11:06:47 +00:00
|
|
|
## Optional HTTP Request Body
|
2016-05-23 12:33:43 +00:00
|
|
|
# body = '''
|
|
|
|
# {'fake':'data'}
|
|
|
|
# '''
|
2016-05-25 11:41:21 +00:00
|
|
|
|
2017-02-01 14:21:08 +00:00
|
|
|
## Optional substring or regex match in body of the response
|
2017-08-15 18:50:08 +00:00
|
|
|
# response_string_match = "\"service_status\": \"up\""
|
|
|
|
# response_string_match = "ok"
|
|
|
|
# response_string_match = "\".*_status\".?:.?\"up\""
|
2017-02-01 14:21:08 +00:00
|
|
|
|
2016-05-25 11:41:21 +00:00
|
|
|
## Optional SSL Config
|
|
|
|
# ssl_ca = "/etc/telegraf/ca.pem"
|
|
|
|
# ssl_cert = "/etc/telegraf/cert.pem"
|
|
|
|
# ssl_key = "/etc/telegraf/key.pem"
|
|
|
|
## Use SSL but skip chain & host verification
|
|
|
|
# insecure_skip_verify = false
|
2017-08-15 18:50:08 +00:00
|
|
|
|
|
|
|
## HTTP Request Headers (all values must be strings)
|
|
|
|
# [inputs.http_response.headers]
|
|
|
|
# Host = "github.com"
|
2016-03-31 07:33:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Measurements & Fields:
|
|
|
|
|
|
|
|
- http_response
|
|
|
|
- response_time (float, seconds)
|
|
|
|
- http_response_code (int) #The code received
|
2017-06-06 20:39:07 +00:00
|
|
|
- result_type (string) # success, timeout, response_string_mismatch, connection_failed
|
2016-03-31 07:33:28 +00:00
|
|
|
|
|
|
|
### Tags:
|
|
|
|
|
|
|
|
- All measurements have the following tags:
|
|
|
|
- server
|
2016-03-31 10:18:19 +00:00
|
|
|
- method
|
2016-03-31 07:33:28 +00:00
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
```
|
2016-03-31 10:18:19 +00:00
|
|
|
http_response,method=GET,server=http://www.github.com http_response_code=200i,response_time=6.223266528 1459419354977857955
|
2016-03-31 07:33:28 +00:00
|
|
|
```
|