2016-03-31 07:33:28 +00:00
|
|
|
# Example Input Plugin
|
|
|
|
|
|
|
|
This input plugin will test HTTP/HTTPS connections.
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```
|
|
|
|
# List of UDP/TCP connections you want to check
|
|
|
|
[[inputs.http_response]]
|
2016-03-31 10:18:19 +00:00
|
|
|
## Server address (default http://localhost)
|
|
|
|
address = "http://github.com"
|
|
|
|
## Set response_timeout (default 10 seconds)
|
2016-03-31 08:54:08 +00:00
|
|
|
response_timeout = 10
|
2016-03-31 11:06:47 +00:00
|
|
|
## HTTP Request Method
|
2016-03-31 07:33:28 +00:00
|
|
|
method = "GET"
|
2016-03-31 10:18:19 +00:00
|
|
|
## HTTP Request Headers
|
|
|
|
headers = '''
|
|
|
|
Host: github.com
|
|
|
|
'''
|
|
|
|
## Whether to follow redirects from the server (defaults to false)
|
|
|
|
follow_redirects = true
|
2016-03-31 11:06:47 +00:00
|
|
|
## Optional HTTP Request Body
|
|
|
|
body = '''
|
|
|
|
{'fake':'data'}
|
|
|
|
'''
|
2016-03-31 07:33:28 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Measurements & Fields:
|
|
|
|
|
|
|
|
- http_response
|
|
|
|
- response_time (float, seconds)
|
|
|
|
- http_response_code (int) #The code received
|
|
|
|
|
|
|
|
### 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:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ ./telegraf -config telegraf.conf -input-filter http_response -test
|
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
|
|
|
```
|