2016-02-28 20:38:46 +00:00
|
|
|
# Telegraf Plugin: Nginx
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```
|
|
|
|
# Read Nginx's basic status information (ngx_http_stub_status_module)
|
|
|
|
[[inputs.nginx]]
|
|
|
|
## An array of Nginx stub_status URI to gather stats.
|
|
|
|
urls = ["http://localhost/server_status"]
|
2017-06-08 00:52:10 +00:00
|
|
|
|
2018-05-04 23:33:23 +00:00
|
|
|
## Optional TLS Config
|
|
|
|
# tls_ca = "/etc/telegraf/ca.pem"
|
|
|
|
# tls_cert = "/etc/telegraf/cert.pem"
|
|
|
|
# tls_key = "/etc/telegraf/key.pem"
|
|
|
|
## Use TLS but skip chain & host verification
|
2017-06-08 00:52:10 +00:00
|
|
|
# insecure_skip_verify = false
|
|
|
|
|
|
|
|
## HTTP response timeout (default: 5s)
|
|
|
|
response_timeout = "5s"
|
2016-02-28 20:38:46 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Measurements & Fields:
|
|
|
|
|
2016-02-28 20:41:16 +00:00
|
|
|
- Measurement
|
2016-02-28 20:38:46 +00:00
|
|
|
- accepts
|
|
|
|
- active
|
|
|
|
- handled
|
|
|
|
- reading
|
|
|
|
- requests
|
|
|
|
- waiting
|
2016-04-01 15:59:09 +00:00
|
|
|
- writing
|
2016-02-28 20:38:46 +00:00
|
|
|
|
|
|
|
### Tags:
|
|
|
|
|
|
|
|
- All measurements have the following tags:
|
|
|
|
- port
|
|
|
|
- server
|
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
Using this configuration:
|
|
|
|
```
|
|
|
|
[[inputs.nginx]]
|
|
|
|
## An array of Nginx stub_status URI to gather stats.
|
|
|
|
urls = ["http://localhost/status"]
|
|
|
|
```
|
|
|
|
|
|
|
|
When run with:
|
|
|
|
```
|
2017-05-12 22:22:29 +00:00
|
|
|
./telegraf --config telegraf.conf --input-filter nginx --test
|
2016-02-28 20:38:46 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
It produces:
|
|
|
|
```
|
|
|
|
* Plugin: nginx, Collection 1
|
|
|
|
> nginx,port=80,server=localhost accepts=605i,active=2i,handled=605i,reading=0i,requests=12132i,waiting=1i,writing=1i 1456690994701784331
|
|
|
|
```
|