From 78d31992d7933cf573cdbca7eb40e8764004d94f Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 27 Apr 2017 11:23:37 -0700 Subject: [PATCH] Update haproxy README --- plugins/inputs/haproxy/README.md | 29 +++++++++++++++++++++++------ plugins/inputs/haproxy/haproxy.go | 10 +++++----- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/plugins/inputs/haproxy/README.md b/plugins/inputs/haproxy/README.md index fe107b559..dfb955796 100644 --- a/plugins/inputs/haproxy/README.md +++ b/plugins/inputs/haproxy/README.md @@ -7,13 +7,30 @@ ```toml # SampleConfig [[inputs.haproxy]] - servers = ["http://1.2.3.4/haproxy?stats", "/var/run/haproxy*.sock"] -# 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 + ## 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 + ## 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 ``` #### `servers` diff --git a/plugins/inputs/haproxy/haproxy.go b/plugins/inputs/haproxy/haproxy.go index 151312d66..c5c83e5d4 100644 --- a/plugins/inputs/haproxy/haproxy.go +++ b/plugins/inputs/haproxy/haproxy.go @@ -42,19 +42,19 @@ var sampleConfig = ` ## 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 - # + ## 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"] - # + # 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 + # keep_field_names = true ## Optional SSL Config # ssl_ca = "/etc/telegraf/ca.pem"