def METHOD_NAME(self, instance):
    host = instance.get('host')
    port = int(instance.get('port', 2222))  # 2222 is default
    tags = instance.get('tags', [])
    if tags is None:
        tags = []
    service_check_tags = ['host:{}'.format(host), 'port:{}'.format(port)] + tags
    service_check_tags = list(set(service_check_tags))
    try:
        addrs = socket.getaddrinfo(host, port, 0, 0, socket.IPPROTO_TCP)
    except socket.gaierror as e:
        self.log.warning("Unable to retrieve address info for %s:%s - %s", host, port, e)
        self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL, tags=service_check_tags)
        return None
    response = ""
    for addr in addrs:
        try:
            if addr[1] == socket.SOCK_STREAM:
                client = socket.socket(*addr[0:3])
                client.connect(addr[-1])
                self.log.debug("Querying: %s:%s", host, port)
                while 1:
                    data = ensure_unicode(client.recv(1024))
                    if not data:
                        break
                    response = ''.join([response, data])
            client.close()
            break
        except socket.error as e:
            self.log.warning("Unable to connect to %s - %s", addr[-1], e)
    status = AgentCheck.OK if response else AgentCheck.CRITICAL
    self.service_check(self.SERVICE_CHECK_NAME, status, tags=service_check_tags)
    return response