From 2f417d431d11cda0699fa2893738c8228c62f55e Mon Sep 17 00:00:00 2001 From: Sachin Rase Date: Thu, 7 Jul 2016 17:45:59 -0700 Subject: [PATCH] Ignore the ssl cert part for nginx status Ignore the cert part as its not going to match top level domain (http://www.xyz.com) if https behind many hosts (host.serverice.datacenter.xyz.com ) --- plugins/inputs/nginx/nginx.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/inputs/nginx/nginx.go b/plugins/inputs/nginx/nginx.go index b15b539de..b674abb7d 100644 --- a/plugins/inputs/nginx/nginx.go +++ b/plugins/inputs/nginx/nginx.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "net/http" + "crypto/tls" "net/url" "strconv" "strings" @@ -61,6 +62,8 @@ var tr = &http.Transport{ var client = &http.Client{ Transport: tr, Timeout: time.Duration(4 * time.Second), + // ignore the cert part as its not going to match top level domain if https behind many hosts + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } func (n *Nginx) gatherUrl(addr *url.URL, acc telegraf.Accumulator) error {