2016-09-08 10:54:20 +00:00
# HAproxy Input Plugin
[HAproxy ](http://www.haproxy.org/ ) input plugin gathers metrics directly from any running HAproxy instance. It can do so by using CSV generated by HAproxy status page or from admin socket(s).
### Configuration:
```toml
# SampleConfig
[[inputs.haproxy]]
2017-04-27 18:23:37 +00:00
## An array of address to gather stats about. Specify an ip on hostname
## with optional port. ie localhost, 10.10.3.33:1936, etc.
## Make sure you specify the complete path to the stats endpoint
## including the protocol, ie http://10.10.3.33:1936/haproxy?stats
2017-04-27 18:20:41 +00:00
2017-04-27 18:23:37 +00:00
## If no servers are specified, then default to 127.0.0.1:1936/haproxy?stats
servers = ["http://myhaproxy.com:1936/haproxy?stats"]
## You can also use local socket with standard wildcard globbing.
## Server address not starting with 'http' will be treated as a possible
## socket, so both examples below are valid.
# servers = ["socket:/run/haproxy/admin.sock", "/run/haproxy/*.sock"]
## By default, some of the fields are renamed from what haproxy calls them.
## Setting this option to true results in the plugin keeping the original
## field names.
# keep_field_names = true
## 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
2016-09-08 10:54:20 +00:00
```
2017-02-02 13:46:53 +00:00
#### `servers`
2016-09-08 10:54:20 +00:00
Server addresses need to explicitly start with 'http' if you wish to use HAproxy status page. Otherwise, address will be assumed to be an UNIX socket and protocol (if present) will be discarded.
2017-01-12 08:47:01 +00:00
For basic authentication you need to add username and password in the URL: `http://user:password@1.2.3.4/haproxy?stats` .
2016-09-08 10:54:20 +00:00
Following examples will all resolve to the same socket:
```
socket:/var/run/haproxy.sock
unix:/var/run/haproxy.sock
foo:/var/run/haproxy.sock
/var/run/haproxy.sock
```
When using socket names, wildcard expansion is supported so plugin can gather stats from multiple sockets at once.
If no servers are specified, then the default address of `http://127.0.0.1:1936/haproxy?stats` will be used.
2017-02-02 13:46:53 +00:00
#### `keep_field_names`
By default, some of the fields are renamed from what haproxy calls them. Setting the `keep_field_names` parameter to `true` will result in the plugin keeping the original field names.
2016-09-08 10:54:20 +00:00
### Measurements & Fields:
2017-02-02 13:46:53 +00:00
Plugin will gather measurements outlined in [HAproxy CSV format documentation ](https://cbonte.github.io/haproxy-dconv/1.7/management.html#9.1 ).
2016-09-08 10:54:20 +00:00
### Tags:
- All measurements have the following tags:
- server - address of server data is gathered from
- proxy - proxy name as reported in `pxname`
- sv - service name as reported in `svname`