def METHOD_NAME(self):
    host = CowrieConfig.get("output_influx", "host", fallback="")
    port = CowrieConfig.getint("output_influx", "port", fallback=8086)
    ssl = CowrieConfig.getboolean("output_influx", "ssl", fallback=False)
    self.client = None
    try:
        self.client = InfluxDBClient(host=host, port=port, ssl=ssl, verify_ssl=ssl)
    except InfluxDBClientError as e:
        log.msg(f"output_influx: I/O error({e.code}): '{e.message}'")
        return
    if self.client is None:
        log.msg("output_influx: cannot instantiate client!")
        return
    if CowrieConfig.has_option(
        "output_influx", "username"
    ) and CowrieConfig.has_option("output_influx", "password"):
        username = CowrieConfig.get("output_influx", "username")
        password = CowrieConfig.get("output_influx", "password", raw=True)
        self.client.switch_user(username, password)
    try:
        dbname = CowrieConfig.get("output_influx", "database_name")
    except Exception:
        dbname = "cowrie"
    retention_policy_duration_default = "12w"
    retention_policy_name = dbname + "_retention_policy"
    if CowrieConfig.has_option("output_influx", "retention_policy_duration"):
        retention_policy_duration = CowrieConfig.get(
            "output_influx", "retention_policy_duration"
        )
        match = re.search(r"^\d+[dhmw]{1}$", retention_policy_duration)
        if not match:
            log.msg(
                "output_influx: invalid retention policy."
                f"Using default '{retention_policy_duration}'.."
            )
            retention_policy_duration = retention_policy_duration_default
    else:
        retention_policy_duration = retention_policy_duration_default
    database_list = self.client.get_list_database()
    dblist = [str(elem["name"]) for elem in database_list]
    if dbname not in dblist:
        self.client.create_database(dbname)
        self.client.create_retention_policy(
            retention_policy_name,
            retention_policy_duration,
            1,
            database=dbname,
            default=True,
        )
    else:
        retention_policies_list = self.client.get_list_retention_policies(
            database=dbname
        )
        rplist = [str(elem["name"]) for elem in retention_policies_list]
        if retention_policy_name not in rplist:
            self.client.create_retention_policy(
                retention_policy_name,
                retention_policy_duration,
                1,
                database=dbname,
                default=True,
            )
        else:
            self.client.alter_retention_policy(
                retention_policy_name,
                database=dbname,
                duration=retention_policy_duration,
                replication=1,
                default=True,
            )
    self.client.switch_database(dbname)