def _check(self, instance):
        addr, username, password, http_response_status_code, timeout, include_content, headers,\
            response_time, content_match, tags, disable_ssl_validation,\
            ssl_expire, instance_ca_certs = self._load_conf(instance)
        start = time.time()

        service_checks = []
        try:
            self.log.debug("Connecting to %s" % addr)
            if disable_ssl_validation and urlparse(addr)[0] == "https":
                self.warning("Skipping SSL certificate validation for %s based on configuration"
                             % addr)

            auth = None
            if username is not None and password is not None:
                auth = (username, password)

            r = requests.get(addr, auth=auth, timeout=timeout, headers=headers,
                             verify=False if disable_ssl_validation else instance_ca_certs)

        except (socket.timeout, requests.exceptions.ConnectionError, requests.exceptions.Timeout) as e:
            length = int((time.time() - start) * 1000)
            self.log.info("%s is DOWN, error: %s. Connection failed after %s ms"
                          % (addr, str(e), length))
            service_checks.append((
                self.SC_STATUS,
                Status.DOWN,
                "%s. Connection failed after %s ms" % (str(e), length)
            ))

        except socket.error, e:
            length = int((time.time() - start) * 1000)
            self.log.info("%s is DOWN, error: %s. Connection failed after %s ms"
                          % (addr, repr(e), length))
            service_checks.append((
                self.SC_STATUS,
                Status.DOWN,
                "Socket error: %s. Connection failed after %s ms" % (repr(e), length)
            ))

        except Exception, e:
            length = int((time.time() - start) * 1000)
            self.log.error("Unhandled exception %s. Connection failed after %s ms"
                           % (str(e), length))
            raise

        # Only report this metric if the site is not down
        if response_time and not service_checks:
            # Stop the timer as early as possible
            running_time = time.time() - start
            # Store tags in a temporary list so that we don't modify the global tags data structure
            tags_list = list(tags)
            tags_list.append('url:%s' % addr)
            self.gauge('network.http.response_time', running_time, tags=tags_list)

        # Check HTTP response status code
        if not (service_checks or re.match(http_response_status_code, str(r.status_code))):
            self.log.info("Incorrect HTTP return code. Expected %s, got %s"
                          % (http_response_status_code, str(r.status_code)))

            service_checks.append((
                self.SC_STATUS,
                Status.DOWN,
                "Incorrect HTTP return code. Expected %s, got %s"
                % (http_response_status_code, str(r.status_code))
            ))

        if not service_checks:
            # Host is UP
            # Check content matching is set
            if content_match:
                content = r.content
                if re.search(content_match, content):
                    self.log.debug("%s is found in return content" % content_match)
                    service_checks.append((
                        self.SC_STATUS, Status.UP, "UP"
                    ))
                else:
                    self.log.info("%s not found in content" % content_match)
                    self.log.debug("Content returned:\n%s" % content)
                    service_checks.append((
                        self.SC_STATUS,
                        Status.DOWN,
                        'Content "%s" not found in response' % content_match
                    ))
            else:
                self.log.debug("%s is UP" % addr)
                service_checks.append((
                    self.SC_STATUS, Status.UP, "UP"
                ))

        if ssl_expire and urlparse(addr)[0] == "https":
            status, msg = self.check_cert_expiration(instance, timeout, instance_ca_certs)
            service_checks.append((
                self.SC_SSL_CERT, status, msg
            ))

        return service_checks

    # FIXME: 5.3 drop this function
dataset/ETHPy150Open serverdensity/sd-agent/checks.d/http_check.py/HTTPCheck._check/original