diff --git a/modules/icinga2/api.go b/modules/icinga2/api.go index 62c3664..22fcb2a 100644 --- a/modules/icinga2/api.go +++ b/modules/icinga2/api.go @@ -76,9 +76,10 @@ func endpointIsReachable(endpoint string) error { func collectStatus(endpoint string, c *collection.Collection) error { c.Log.Debugf("request data from endpoint '%s/v1/status'", endpoint) - // allow insecure connections because of Icinga 2 certificates + // allow insecure connections because of Icinga 2 certificates and add proxy if one is defined in the environments tr := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, //nolint:gosec + Proxy: http.ProxyFromEnvironment, } client := &http.Client{Transport: tr}